美文网首页统计与科研
方差齐次性检验Comparing Variances in R

方差齐次性检验Comparing Variances in R

作者: 谢俊飞 | 来源:发表于2020-04-02 20:06 被阅读0次

在STHDA网站Comparing Variances in R 一文中,专门对正态性检验做了详致的说明,翻译并整理入下:

图片.png

(一) F检验F-Test

F检验用于评估两个总体(A和B)的方差是否相等。
F-Test: Compare Two Variances in R.

> var.test(len ~ supp, data = my_data)

    F test to compare two variances

data:  len by supp
F = 0.6386, num df = 29, denom df = 29, p-value = 0.2331
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
 0.3039488 1.3416857
sample estimates:
ratio of variances 
         0.6385951 

(二) 比较方差的统计检验 Homogeneity of variances

有许多检验可以检测不同组之间方差的均等性(均一性),包括:

  • F-test: Compare the variances of two samples. The data must be normally distributed.
  • Bartlett’s test: Compare the variances of k samples, where k can be more than two samples. The data must be normally distributed. The Levene test is an alternative to the Bartlett test that is less sensitive to departures from normality.
  • Levene’s test: Compare the variances of k samples, where k can be more than two samples. It’s an alternative to the Bartlett’s test that is less sensitive to departures from normality.
  • Fligner-Killeen test: a non-parametric test which is very robust against departures from normality.

Bartlett’s test用于测试k个样本中方差的均匀性,其中k可以大于2。 适用于正态分布的数据。 当数据分布为非正态分布时,下一部分将描述的Levene检验是Bartlett检验的更稳健的替代方案。

2.1 Compute Bartlett’s test in R
# Bartlett’s test with one independent variable:
> bartlett.test(weight ~ group, data = PlantGrowth)

    Bartlett test of homogeneity of variances

data:  weight by group
Bartlett's K-squared = 2.8786, df = 2, p-value = 0.2371

# Bartlett’s test with multiple independent variables: 
> bartlett.test(len ~ interaction(supp,dose), data=ToothGrowth)

    Bartlett test of homogeneity of variances

data:  len by interaction(supp, dose)
Bartlett's K-squared = 6.9273, df = 5, p-value = 0.2261
2.2 Compute Levene’s test in R
library(car)
> # Levene's test with one independent variable
> leveneTest(weight ~ group, data = PlantGrowth)
Levene's Test for Homogeneity of Variance (center = median)
      Df F value Pr(>F)
group  2  1.1192 0.3412
      27               
> # Levene's test with multiple independent variables
> leveneTest(len ~ supp*dose, data = ToothGrowth)
Levene's Test for Homogeneity of Variance (center = median)
      Df F value Pr(>F)
group  5  1.7086 0.1484
      54               
2.3 Compute Fligner-Killeen test in R
> fligner.test(weight ~ group, data = PlantGrowth)

    Fligner-Killeen test of homogeneity of variances

data:  weight by group
Fligner-Killeen:med chi-squared = 2.3499, df = 2, p-value = 0.3088

参考资料:

  1. Comparing Variances in R
  2. 假设检验-方差齐性检验

相关文章

  • 方差齐次性检验Comparing Variances in R

    在STHDA网站Comparing Variances in R 一文中,专门对正态性检验做了详致的说明,翻译并...

  • 15-假设检验之F检验

    F检验(又称为方差齐性检验)主要对于方差齐性或方差同质性进行检验。 独立样本T检验前需要进行方差齐性检验,F检验的...

  • 【r<-基础|统计】变量同质性检验

    问题 你想要(精确)检验样本的方差同质性(同方差,方差齐性)。许多统计检验假设总体同方差。 方案 有许多检验方差同...

  • R做方差齐次检验

    一组数据需要做t检验,了解了一下t检验分为:a.单样本t检验,b.独立双样本t检验和c.成对或非独立样本t检验,三...

  • 02-单因素和双因素方差分析

    1.单因素方差分析 1.1 正态性检验 1.2 方差齐性检验 1.3 单因素ANOVA 1.4 诊断模型(残差检验...

  • r与生物统计(F检验T检验和求0.95的置信区间)

    F检验(方差齐性检验): 主要通过比较两组数据的方差,以确定他们的密度是否有显著性差异(判断两总体方差是否相等,就...

  • 方差齐性检验

    方差齐性检验:目的是检验两个或多个样本方差是不是一样,也就是说数据是不是稳定,变化不大。 一般有2种方法:1.X2...

  • 统计学(52)-正态性与方差齐性

    1、正态性和方差齐性 (1)正态性和方差齐性是经典统计模型应用的两个前提条件,如t检验、方差分析、线性回归等都需要...

  • 假设检验之Levene's Test 检验

    列文方差齐性检验及Levene's Test 检验,用于检验两组及两组以上独立样本的方差是否相等。要求样本为随机样...

  • 一般统计分析与假设检验

    步骤: 检验正太分布 检验方差齐性 检验统计学差异 求均值和标准差 功效分析

网友评论

    本文标题:方差齐次性检验Comparing Variances in R

    本文链接:https://www.haomeiwen.com/subject/ndaxphtx.html