User Tools

Site Tools


r:ftest
A: 175, 168, 168, 190, 156, 181, 182, 175, 174, 179
B: 120, 180, 125, 188, 130, 190, 110, 185, 112, 188

a = c(175, 168, 168, 190, 156, 181, 182, 175, 174, 179)
b = c(120, 180, 125, 188, 130, 190, 110, 185, 112, 188)

var.test(b,a)
    F test to compare two variances

data: b and a
F = 14.6431, num df = 9, denom df = 9, p-value = 0.0004636
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
   3.637133 58.952936
sample estimates:
 ratio of variances
   14.64308

We obtained p-value less than 0.05, then the two variances are not homogeneous. Indeed we can compare the value of F computed with the tabulated value of F for alpha = 0.05, degrees of freedom at numerator = 9, and degrees of freedom of denominator = 9, using the function qf(p, df.num, df.den):

 qf(0.95, 9, 9)
[1] 3.178893
F-computed is greater than F-tabulated, so we can reject the null hypothesis 
H0 of homogeneity of variances.
r/ftest.txt · Last modified: 2016/09/09 09:35 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki