Difference between revisions of "Descriptive statistics"
From Sustainability Methods
(→Videos) |
|||
Line 16: | Line 16: | ||
Standard deviation | Standard deviation | ||
+ | |||
+ | <syntaxhighlight lang="R" line> | ||
+ | |||
+ | #descriptive statistics using the Swiss dataset | ||
+ | swiss | ||
+ | swiss_data<-swiss | ||
+ | |||
+ | #we are choosing the column fertility for this example | ||
+ | #let's begin with calculating the mean | ||
+ | mean(swiss_data$Fertility) | ||
+ | |||
+ | #median | ||
+ | median(swiss_data$Fertility) | ||
+ | |||
+ | #range | ||
+ | range(swiss_data$Fertility) | ||
+ | |||
+ | #standard deviation | ||
+ | sd(swiss_data$Fertility) | ||
+ | |||
+ | #summary - includes minimum, maximum, mean, median, 1st & 3rd Quartile | ||
+ | summary(swiss_data$Fertility) | ||
+ | |||
+ | </syntaxhighlight> | ||
[[File:Bildschirmfoto 2020-03-28 um 15.51.31.png|thumb|left|This graph shows how the standard deviation is spread from the mean.]] | [[File:Bildschirmfoto 2020-03-28 um 15.51.31.png|thumb|left|This graph shows how the standard deviation is spread from the mean.]] |
Revision as of 12:32, 29 March 2020
Descriptive statistics
Descriptive stats are what most people think stats are all about. Many people believe that the simple observation of more or less, or the mere calculation of an average value is what statistics are all about. The media often shows us such descriptive statistics in whimsical bar plots or even pie charts.
Mean
Median
Mode
Range
Standard deviation
#descriptive statistics using the Swiss dataset swiss swiss_data<-swiss #we are choosing the column fertility for this example #let's begin with calculating the mean mean(swiss_data$Fertility) #median median(swiss_data$Fertility) #range range(swiss_data$Fertility) #standard deviation sd(swiss_data$Fertility) #summary - includes minimum, maximum, mean, median, 1st & 3rd Quartile summary(swiss_data$Fertility)
External Links
Videos
Descriptive Statistics: A whole video series about descriptive statistics from the Khan academy
Standard Deviation: A brief explanation
Mode, Median, Mean, Range & Standard Deviation: A good summary