Section 37 Data Analysis: Summary Statistics
Read the help file for the different functions to create summary statistics of the data.
Calculate
meanandmedianof the numeric data.Explore the help for the function
fivenum. Apply the function.Calculate the quartile of the numeric data.
Calculate variance and standard deviation of the numeric data
Calculate range, inter-quartile range and coefficient of variation
Obtain the counts for each level of
SexfactorObtain the counts for each level of
VacfactorObtain the counts for combination of
Sex&VacfactorsCalculate the correlation between
AgeandWt
37.1 Summary Statistics
mean(DF$Wt, na.rm=TRUE)
median(DF$Wt, na.rm=TRUE)
fivenum(DF$Wt, na.rm=TRUE)
range(DF$Wt, na.rm=TRUE)
quantile(DF$Wt, probs = c(0.25, 0.50, 0.75), na.rm = TRUE)
IQR(DF$Wt, na.rm = TRUE)
sd(DF$Wt, na.rm = TRUE)
sd(DF$Wt, na.rm = TRUE)/mean(DF$Wt, na.rm=TRUE)
table(DF$Sex)
sum(DF$Sex == 'M')
sum(DF$Sex == 'F')
table(DF$Vac)
with(data=DF, table(Sex, Vac))
with(data=DF, cor(Age, Wt, use = 'complete.obs'))