数学之路-数据分析进阶-总体方差检测

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, ...)

Arguments

x, y

numeric vectors of data values, or fitted linear model objects (inheriting from class "lm").

ratio

the hypothesized ratio of the population variances of x and y.

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". You can specify just the initial letter.

conf.level

confidence level for the returned confidence interval.

bartlett.test()所属R语言包:stats
Performs Bartlett's test of the null that the variances in each of the groups (samples) are the same.
进行巴特利特空测试,在每个组(样品)的差异是相同的。


设某程序在不同客户端执行的消耗时间要求较稳定,方差小,优化的效果是使该服务程序的消耗时间保持稳定,方差更小。下面是优化前和优化后的抽样数据请问优化有作用吗?

优化前: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

本博客所有内容是原创,如果转载请注明来源

http://blog.csdn.net/myhaspl/


> 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 

p>0.05,不拒绝原假设,表示x的方差比y的方差大。

你可能感兴趣的:(数学之路-数据分析进阶-总体方差检测)