In: Statistics and Probability
Use the Program R:
The following data gives the weight for 8 corn cobs which were produced using an organic corn fertilizer:
212, 234, 259, 189, 245, 176, 203, 215
(a) For this sample of n = 8 observations, use R to obtain the mean, the median, the interquartile range and the standard deviation.
(b) Among the four statistics, which are measures of central tendency and which are measures of dispersion.
(c) Are there any outliers in this sample? If so, which values are outliers?
(d) With R, produce a quantile-quantile plot for these data. Is it reasonable to assume that the weight is normally distributed? Explain.
(e) Give a point estimate for the mean weight of the population and the standard deviation of the estimate.
SolutionA:
corn_cobs <- c(212, 234, 259, 189, 245, 176, 203, 215)
mean(corn_cobs)
median(corn_cobs)
sd(corn_cobs)
fivenum(corn_cobs)
Output:
> mean(corn_cobs)
[1] 216.625
> median(corn_cobs)
[1] 213.5
> sd(corn_cobs)
[1] 28.09645
> fivenum(corn_cobs)
[1] 176.0 196.0 213.5 239.5 259.0
mean=216.625
median=213.5
standard deviation =28.09645
IQR=Q3-Q1=239.5-196.0 =43.5
(b) Among the four statistics, which are measures of central tendency and which are measures of dispersion.
Meana nd median are measures of central tendency
stanard deviation and IQR are measures of dispersion.
Solutionc:
(c) Are there any outliers in this sample? If so, which values are outliers?
Rcode to get boxplot is
boxplot(corn_cobs,main="boxplot for corn_cobs")
oUTPUT:
From bxplot we see there are no outliers
Solutiond
qqnorm(corn_cobs)
qqline(corn_cobs)
output:
From QQ plot the points are not on starigh line deviates form normality
Test for normality:
shapiro.test(corn_cobs)
From shapiro test output:
Shapiro-Wilk normality test
data: corn_cobs
W = 0.97845, p-value = 0.9548
p=0.9548,p>0.05 Data devaites from normal distribution.
(e) Give a point estimate for the mean weight of the population and the standard deviation of the estimate.
Point estiamte for pop mean=sample mean=216.625
Point estiamte for pop standard deviation=sample stddev=28.09645