ONE SAMPLE T-TEST USING R CONSOLE
Q. 10 pieces of sarees were selected and number of defects were calculated as: 4, 4,0,3,3,2,3,5,8,6,6
test weather average number of defects on such a cloth is less than 5.
Sol.
Step I: we want to test a null hypothesis
H0: mu = 5
against an alternating hypothesis
H1: mu < 5
Step II: Test statistic
t = x_bar - mu_not/(s/sqrt(n)) ~ t_(n-1)
t = x_bar - mu_not/(s/sqrt(n)) ~ t_(n-1)
where s^2=(1/n-1) summation(1 to n)(x_i - x_bar)^2 ~ t_(n-1)
and x_bar = (1/n) summation(1 to n)x_i
Command used:
> defect=c(4,0,3,3,2,3,5,8,6,6)
> t.test(defect,alt="less",mu=5)
One Sample t-test
data: defect
t = -1.3693, df = 9, p-value = 0.102
alternative hypothesis: true mean is less than 5
95 percent confidence interval:
-Inf 5.338716
sample estimates:
mean of x
4
> t.test(defect,alt="less",mu=5)
One Sample t-test
data: defect
t = -1.3693, df = 9, p-value = 0.102
alternative hypothesis: true mean is less than 5
95 percent confidence interval:
-Inf 5.338716
sample estimates:
mean of x
4
Conclusion: Since the p-values is greater than 0.05 so we accept the null hypothesis.