var.test(x, ...) ## Default S3 method: var.test(x, y, ratio = 1, alternative = c("two.sided", "less", "greater"), conf.level = 0.95, ...) ## S3 method for class 'formula' var.test(formula, data, subset, na.action, ...)
x, y |
numeric vectors of data values, or fitted linear model objects (inheriting from class |
ratio |
the hypothesized ratio of the population variances of |
alternative |
a character string specifying the alternative hypothesis, must be one of |
conf.level |
confidence level for the returned confidence interval. |
设某项程序在不同客户端执行的消耗时间要求较稳定,方差小,优化的效果是使该服务程序的消耗时间保持稳定,方差更小。下面是优化前和优化后的抽样数据,请问优化有作用吗?
优化前:89 110 90 190 50 70 130 140 120 68
优化后:100 90 70 89 90 98 110 88 69 78
var1为x方差,var2为y方差,ratio为它们的比例
two.sided :var1/var2<>ratio
less: var1/var2<ratio
greater: var1/var2>ratio
ratio缺少值为 1
> x<-c(89,110,90,190,50,70,130,140,120,68)
> y<-c(100,90,70,89,90,98,110,88,69,78)
> var.test(x,y,alternative ="less")
F test to compare two variances
data: x and y
F = 10.1341, num df = 9, denom df = 9, p-value = 0.999
alternative hypothesis: true ratio of variances is less than 1
95 percent confidence interval:
0.00000 32.21533
sample estimates:
ratio of variances
10.13414