【问题标题】:R - pairwise_t_test Test Statistics Unchanged When Switching Between Pooled Standard Deviation and non-Pooled Stardard DeviationR - 在合并标准偏差和非合并标准偏差之间切换时,pairwise_t_test 测试统计不变
【发布时间】:2021-07-15 01:20:49
【问题描述】:

在回顾成对 t 检验作为单向重复测量方差分析的事后时,我注意到一个奇怪的地方。当我合并标准差时,rstatix 库中 pair_t_test 的测试统计数据没有改变——实际上输出都没有改变。

我的理解是,汇集标准差的重点是更准确地估计检验统计量。但是,在尝试此操作时,我找不到输出的差异(见下文)。

我的理解有误吗?合并标准差对多个成对比较(尽管存在球形)有什么影响?

我使用了以下数据设置:

library(rstatix)
library(tidyverse)

selfesteem.test <- selfesteem %>%
  gather(key = "time", value = "score", t1, t2, t3) %>%
  convert_as_factor(id, time)

在以下代码中使用合并标准差:

selfesteem.test %>%
  pairwise_t_test(
    score ~ time,
    paired = TRUE,
    p.adjust.method = "bonferroni",
    pool.sd = TRUE
  )

导致:

# A tibble: 3 x 10
  .y.   group1 group2    n1    n2 statistic    df           p    p.adj p.adj.signif
* <chr> <chr>  <chr>  <int> <int>     <dbl> <dbl>       <dbl>    <dbl> <chr>       
1 score t1     t2        10    10     -4.97     9 0.000772    0.002    **          
2 score t1     t3        10    10    -13.2      9 0.000000334 0.000001 ****        
3 score t2     t3        10    10     -4.87     9 0.000886    0.003    **          

以下代码:

selfesteem.test %>%
  pairwise_t_test(
    score ~ time,
    paired = TRUE,
    p.adjust.method = "bonferroni",
    pool.sd = FALSE
  )

结果相同:

# A tibble: 3 x 10
  .y.   group1 group2    n1    n2 statistic    df           p    p.adj p.adj.signif
* <chr> <chr>  <chr>  <int> <int>     <dbl> <dbl>       <dbl>    <dbl> <chr>       
1 score t1     t2        10    10     -4.97     9 0.000772    0.002    **          
2 score t1     t3        10    10    -13.2      9 0.000000334 0.000001 ****        
3 score t2     t3        10    10     -4.87     9 0.000886    0.003    ** 

【问题讨论】:

    标签: r pairwise rstatix


    【解决方案1】:

    根据?pairwise_t_test

    Pooling 不能推广到配对测试,因此 pool.sd 和paired 不能都为TRUE。

    如果 pool.sd = FALSE,则标准二样本 t 检验适用于所有可能的组对。此方法调用 t.test(),因此接受额外的参数,例如 var.equal。

    此外,Usage 确实显示了否定 (!)

    pairwise_t_test( 数据, 公式, 比较 = NULL, ref.group = NULL, p.adjust.method = "霍尔姆", 配对 = 假, pool.sd = !配对, 详细 = 错误, ... )

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-11
      • 1970-01-01
      • 1970-01-01
      • 2013-08-05
      • 2022-11-27
      • 1970-01-01
      相关资源
      最近更新 更多