In: Statistics and Probability
Many consumers pay careful attention to stated nutritional contents on packaged foods when making purchases. It is therefore important that the information on packages be accurate. A random sample of
n = 12 frozen dinners of a certain type was selected from production during a particular period, and the calorie content of each one was determined. (This determination entails destroying the product, so a census would certainly not be desirable!) Here are the resulting data:
255 |
244 |
239 |
242 |
265 |
245 |
259 |
248 |
225 |
226 |
251 |
233 |
[a] Use R (or Excel) to find the summary statistics of the data. [1 pt]
Copy and paste your computer printout here (or to a blank MS Word document).
[b] Construct a boxplot for the data and comment on any interesting features. [4 pt]
Copy and paste your computer printout here (or to a blank MS Word document).
[c] Construct a normal probability plot (QQplot as well as qqline) and comment on any interesting features. [4 pt]
Copy and paste your computer printout here (or to a blank MS Word document).
[d] Use an appropriate test to ensure the data set satisfies the normality assumption. [3 pt]
What is your conclusion regarding the data set?
[e] Is it reasonable to test hypotheses about mean calorie content m by using a t-test? Explain why or why not.
Answer: Yes No E Circle one [1 pt]
Explanation: [3 pt]
[e] The stated calorie content is m = 240. Does the boxplot in [a] suggest the true mean content differs from the stated value? Explain your reasoning. [3 pt]
[f] Carry out a formal test of the hypotheses suggested in part [e]
Write your hypotheses in symbols and in words. [8 pt]
Use statistical software (such as R) to get analysis results. State what the results tell you about the data. [8 pt]
Solution:
summary statistics are:
length(caloriecontent)
12
mean(caloriecontent)
244.3333
sd(caloriecontent)
12.38278
summary(caloriecontent)
Min. 1st Qu. Median Mean 3rd Qu. Max.
225.0 237.5 244.5 244.3 252.0 265.0
From sumamry
mean=244.333
standard deviation=12.38278
sample szie=n=12
Min=225
Q1=237.5
median=244.5
Q3=252.0
max=265.0
Solutionb:
Rcode:
caloriecontent <- c(255,
244,
239,
242,
265,
245,
259,
248,
225,
226,
251,
233)
boxplot(caloriecontent,main="boxplot for frozen dinners
-caloriecontent")
abline(h = min(caloriecontent), col = "Blue")
abline(h = max(caloriecontent), col = "Yellow")
abline(h = median(caloriecontent), col = "Green")
abline(h = quantile(caloriecontent, c(0.25, 0.75)), col =
"Red")
fivenum(caloriecontent)
From bxoplot we observe
no outilers
Fiveumber sumamry is
225.0 236.0 244.5 253.0 265.0
MIN=225
Q1=236
Q2=244.5
Q3=253
MAX=265
Solutionc:
Rcode:
qqnorm(caloriecontent)
qqline(caloriecontent)
From normal QQ plot we observe
sample follows normal distribution
as most of the points fall on the straight line
[d] Use an appropriate test to ensure the data set satisfies the normality assumption.
perform shapiro .test
Null hypothesis:Data comes from normal distribution
Alternative hypothesis:Data do not come from normal distribution
Rcode:
shapiro.test(caloriecontent)
output:
Shapiro-Wilk normality test
data: caloriecontent
W = 0.97361, p-value = 0.9447
test statistic=0.97361
p=0.9447
p>0.05
Fail to reject Ho.
Accept H0.
There is suffcient evidence to conclude that the data comes from
normal distribution.