In: Statistics and Probability
Mean net weight of a sample of bag of chips is 301g (n = 10), but the company’s claim is 300g. Find out if our sample is statistically different from the company’s claim. Estimated SD = 0.523. Write an interpretation
R-commands and outputs:
xbar=301 # Sample mean
n=10 # Sample size
mu0=300 # Specified value of mean (company's claim)
s=0.523 # Estimated standard deviation
# Null hypothesis-H0: mu=mu0 (Mean is insignificant)
# Alternative hypothesis-H1: mu not equal to mu0 (Mean is
statistically different from the company's claim)
#
Clearly it is two-tailed test because we have to check mu in
both directions (less than mu0 and greater than mu0)
# Since, n is small and sigma is unknown so estimated,
"t-test" is appropriate.
# Test statistic is given by
t follows Student's t distribution with (n-1) degrees of freedom.
t0=(xbar-mu0)/(s/sqrt(n)) # test statistic under H0
t0
[1] 6.04642
alpha=0.05 # Assumed significance level 5%
qt(1-alpha/2,df=n-1) # critical value of t
[1] 2.262157
# Decision Rule:
# If calculated value is greater than tabulated value, H0 is
Rejected.
# Here, t(calculated)=6.04642 and
t(tabulated/critical)=2.262157 i.e. t(cal)>t(tab), we
Reject H0.
# Conclusion: Our sample is statistically different from
the company's claim.
#p-value=P(|T|>t0)=observed level of significance
pval=2*(1-pt(tstat,df=n-1))
pval
[1] 0.0001913203
round(pval,4)
[1] 0.0002
# pval < alpha, we Reject H0.