1

我正在运行 2(性别)x 2(建议)受试者之间的方差分析,并且 R 和 SPSS 都报告了相同的方差分析统计数据:对于建议:F = 372.012,效果 df = 1,错误 df = 661;对于 Gender x Advice:F = 45.449,效果 df = 1,错误 df = 2。

在计算偏 eta 平方时,R(跨多个 R 包:rstatix 和 DescTools)报告 Advice 为 0.221,Gender x Advice 为 0.031。但是,SPSS 和使用 Lakens 的效应大小电子表格 ( https://osf.io/ixgcd/ ) 导致 Advice 为 0.360,Gender x Advice 为 0.064。

R 是否以与标准不同的方式计算部分 eta 平方值?

这是一个示例数据集,其中仅包含测试问题所需的变量: https ://docs.google.com/spreadsheets/d/15AIyIfTi9YgMWM5FTl163uddPx1E19xfaU-vMDRlJuI/edit?usp=sharing

这是我在 RStudio 中使用的代码:

# load packages
library(haven)
library(rstatix)
library(DescTools)

# read in data
sample_data <- read_sav([insert file location])

# gather Perception1 and Perception2 into 2 groups
sample_data <- sample_data %>% 
gather(key = "Advice", value = "MaleDom", Perception1,  
      Perception2) %>% 
convert_as_factor(ResponseId, Advice)

# rstatix
# compute anova
anova <- aov(MaleDom ~ Gender*Advice, data = sample_data)

# partial eta squared
partial_eta_squared(anova)

# DescTools
# partial eta squared
EtaSq(anova, type = 2, anova = FALSE)

这是我在 SPSS 中使用的语法:

GLM Perception1 Perception2 BY Gender
/WSFACTOR=advice 2 Polynomial 
/METHOD=SSTYPE(3)
/POSTHOC=Gender(BTUKEY) 
/PLOT=PROFILE(Gender*advice)
/PRINT=DESCRIPTIVE ETASQ HOMOGENEITY 
/CRITERIA=ALPHA(.05)
/WSDESIGN=advice 
/DESIGN=Gender.

注意:我使用的是 SPSS 26 版和 R 3.6.3 版。我有一个 64 位操作系统的 Windows 10。

4

2 回答 2

1

使用它来定义您的数据:

 d.dat <- structure(list(ResponseId = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 
 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 
 27, 28, 29, 30), Gender = c("Woman", "Woman", "Woman", "Woman", 
 "Woman", "Woman", "Woman", "Woman", "Woman", "Woman", "Woman", 
 "Woman", "Woman", "Woman", "Woman", "Man", "Man", "Man", "Man", 
 "Man", "Man", "Man", "Man", "Man", "Man", "Man", "Man", "Man", 
 "Man", "Man"), Perception1 = c(3.33, 4, 3.67, 1.33, 5.33, 4, 
 6.67, 3.33, 4, 3.67, 4.33, 3.33, 5.33, 1, 2, 6.67, 6.33, 5, 5.33, 
 7, 5, 4.67, 4.33, 6, 5.33, 4, 4.33, 4, 7, 3.33), Perception2 = c(6, 
 6.33, 4, 5, 7, 6, 5, 6.67, 4.67, 5, 5.67, 7, 4, 6, 5.67, 4.67, 
 6.33, 6, 5, 4.67, 5, 6, 4, 5.33, 4, 5, 5.67, 4.67, 6, 6.33)), class = "data.frame",
 row.names = c(NA, -30L)) 
于 2020-08-24T14:35:02.443 回答
1

感谢您提供示例数据。由于三个可能的原因,您会得到不同的偏 eta 平方值:

  1. 在 SPSS 中,您将其指定Advice为重复测量因子,而在 R 中,您将其视为主体间因子。
  2. 您在 SPSS 中使用多项式对比作为您的受试者内因子Advice,而在 R 中您使用的是治疗对比。
  3. 您在 SPSS 中使用类型 III 的平方和,在 R 中使用类型 I 的平方和。

您可以像这样在 R 中指定重复测量方差分析(裂区设计):

anova <- aov(MaleDom ~ Gender*Advice + Error(ResponseId/Advice), data=sample_data)

然后

EtaSq(anova, type=1, anova=FALSE)    # note type=1, not 3!

Advice(样本数据)的部分 eta-squared 结果为 0.2659604 。这等于 SPSS 使用以下语法的输出:

GLM Perception1 Perception2 BY Gender
  /WSFACTOR=Advice 2 Simple
  /MEASURE=MaleDom
  /CONTRAST(Gender)=Deviation(1)
  /METHOD=SSTYPE(1)
  /PRINT=ETASQ
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=Advice
  /DESIGN=Gender.

请注意,partial_eta_squared()from packagerstatix不处理重复测量aov()对象,但eta_squared(anova)$Eta_Sq_partialfrom package提供与fromeffectsize相同的输出。EtaSq()DescTools

于 2020-08-24T14:35:41.417 回答