In: Statistics and Probability
A simple Statistic question by using R,
If I have two set of mean proportion data, what test should I use?
such as,
[1] 0.7652632 0.7555354 0.7602588 0.7594096 0.7497992 0.5532588 0.7595661 0.6911504 [9] 0.5964602 0.6369565 0.7355828 0.7346225 0.5913793 0.6499079 0.6327273 0.6091873 [17] 0.6306122 0.5960784 0.5492918 0.6785714 0.5014787 0.5484848 0.5645403 0.6731343 [25] 0.6208191 0.6087248 0.6045045 0.7743390 0.5275862 0.5731278
[1] 0.6564195 0.5928482 0.6806709 0.5546422 0.5438393 0.5906535 0.6764637 0.6487188 [9] 0.5901547 0.6626735 0.5955325 0.7462415 0.5971111 0.5731504 0.6334729 0.6124653 [17] 0.6224686 0.5549067 0.6348427 0.6265627 0.5981283 0.5981034 0.6374002 0.6400281 [25] 0.7951639 0.7002149 0.7037493 0.6003284 0.6924103 0.7035969 0.5354807 0.6441660 [33] 0.5850962 0.6178425 0.5608873 0.5515344 0.6188244 0.5907285 0.6370565 0.5762872 [41] 0.6229073 0.6044919 0.6150885 0.5970907 0.6029415 0.6050567 0.5793054 0.4934299 [49] 0.5536594 0.5976290 0.6712677 0.6082890 0.6201184 0.5589970 0.5568638 0.5559723 [57] 0.6501545 0.5920379 0.5645405 0.5882715 0.5729236 0.6249503 0.6778542 0.5434909 [65] 0.5683645 0.6241660 0.6587552 0.5916995 0.5645792 0.6114187 0.5738135 0.6521985 [73] 0.6564125 0.7089936 0.6521985 0.6364080 0.6445784 0.5712456 0.5789808 0.5493933
and please interpret their p value
Solution:
Perfrom t.test for difference in means in R
create 2 vectors A and B
Null hypothesis:
Ho:mu1=mu2
Alternative Hypothesis:
Ha:mu1 not = mu2
alpha=0.05
Rcode:
A <- c(0.7652632 ,0.7555354 ,0.7602588 ,0.7594096 ,0.7497992,
0.5532588, 0.7595661, 0.6911504, 0.596460)
B <- c(0.6564195 ,0.5928482, 0.6806709 ,0.5546422, 0.5438393
,0.5906535, 0.6764637 ,0.6487188, 0.59015)
t.test(A,B)
Output:
Welch Two Sample t-test
data: A and B
t = 2.98, df = 13.6, p-value = 0.01
alternative hypothesis: true difference in means is not equal to
0
95 percent confidence interval:
0.026533 0.163755
sample estimates:
mean of x mean of y
0.71008 0.61493
From output:
t=2.98
p=0.01
0.01<0.05
p<0.05
P values is less than alpha
Reject Null hypothesis
Accept Alternative Hypothesis
Conclusion:There is suffcient statistical evidence at 5% level of significance to conclude that the 2 set means
(mean proportion data) are different