我在受试者之间进行2(性别)x2(建议),R和SPSS都报告了相同的方差分析:建议:F= 372.012,效果df = 1,错误df = 661;性别x建议:F= 45.449,效果df = 1,df =2。
在计算偏eta平方时,R(跨多个R包: rstatix和DescTools)报告了0.221条建议和0.031条性别x建议。但是,无论是SPSS还是使用Lakens的影响大小电子表格(https://osf.io/ixgcd/),都得到了0.360的建议和0.064的性别x建议。
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 .
发布于 2020-08-24 14:35:02
将此用于定义数据:
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-24 14:35:41
感谢您提供的样本数据。由于三个可能的原因,可以得到不同的偏eta平方值:
Advice是一个重复的测量因子,而在R中你把它当作被试之间的因子,Advice使用多项式对比,而在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!结果0.2659604例Advice (样本数据)的部分eta平方值。这等于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.注意,来自package rstatix的rstatix不处理重复度量的aov()对象,但是来自package effectsize的eta_squared(anova)$Eta_Sq_partial提供了与DescTools中的EtaSq()相同的输出。
https://stackoverflow.com/questions/63382495
复制相似问题