Konfidensintervall / F-test i R

Les hele artikkelen

Hvorfor blir ikke dette identisk?

Jeg trodde jeg lagde et 95% konfidensintervall for F-statistikken. Det blir litt negativ skjevhet, blant annet.

Kode i R:

F = sd(x)**2/sd(y)**2

print(F)

interval = c(qf(0.05/2,length(x)-1,length(y)-1), qf(1-0.05/2,length(x)-1,length(y)-1))

print(interval)

print(var.test(x,y,ratio=1,conf.level=0.95))

Output:

[1] 1.279251
[1] 0.2483859 4.0259942

	F test to compare two variances

data:  x and y
F = 1.2793, num df = 9, denom df = 9, p-value = 0.7197
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
 0.3177479 5.1502577
sample estimates:
ratio of variances 
          1.279251 

Â