Cohen' SD用于与互动的GLM模型
我正在尝试找到Cohen的D效应大小,以确保我的模型的主要效果。
这里有一些代码来创建数据框架的一部分:
RA <- c(40, 32, 41, 9, 27, 31, 29, 28, 48, 5, 18, 5, 3, 31, 31)
Sex <- c('M', 'M', 'M', 'M', 'F', 'M', 'F', 'M', 'F', 'F', 'F', 'M', 'F', 'F', 'F')
Mass <- c(10.9535, 4.3235, 9.2485, 4.8235, 6.896, 8.2075, 9.281, 0.734, 9.603, 0.973, 10.3435, 0.9505, 7.384, 6.935, 8.936)
Exp <- c('Single', 'Mixed', 'Single','Double','Single','Single','Single','Double','Single','Mixed','Double','Mixed','Mixed','Single','Single')
LastExp <- c('W','L','L','L','W','L','W','L','W','W','W','L','L','L','L')
然后,我的GLM模型是:
RAmodel <- glm(RA~Sex*Exp*LastExp+Mass,family=poisson())
我能够使用Emmeans软件包找到每个成对比较的Cohen的D效应大小:
emRA <- emmeans(RAmodel, ~Sex*Exp*LastExp)
eff_size(emRA, sigma = sigma(RAmodel),edf=31)
但是,我真正想要的是找到Cohen的d效应大小的主要模型大小,因此我可能能够提出诸如“ EXP对RA具有更大效果的效果”之类的主张。我想到的是要以某种方式获得看起来有点像我从中获得的输出:
car::Anova(RAmodel)
但是将Cohen的D包括在其中。我尝试使用Effsize软件包,但我认为模型中的交互和非数字变量使它变得困难。
如果没有完整的数据集,其中一些行不起作用,我会提前道歉。我将感谢任何帮助。
I'm trying to find the Cohen's d effect sizes for the main effects of my model.
Here's a bit of code to create part of the data frame:
RA <- c(40, 32, 41, 9, 27, 31, 29, 28, 48, 5, 18, 5, 3, 31, 31)
Sex <- c('M', 'M', 'M', 'M', 'F', 'M', 'F', 'M', 'F', 'F', 'F', 'M', 'F', 'F', 'F')
Mass <- c(10.9535, 4.3235, 9.2485, 4.8235, 6.896, 8.2075, 9.281, 0.734, 9.603, 0.973, 10.3435, 0.9505, 7.384, 6.935, 8.936)
Exp <- c('Single', 'Mixed', 'Single','Double','Single','Single','Single','Double','Single','Mixed','Double','Mixed','Mixed','Single','Single')
LastExp <- c('W','L','L','L','W','L','W','L','W','W','W','L','L','L','L')
Then my glm model is:
RAmodel <- glm(RA~Sex*Exp*LastExp+Mass,family=poisson())
I was able to find the Cohen's d effect sizes for each pairwise comparison using the emmeans package as follows:
emRA <- emmeans(RAmodel, ~Sex*Exp*LastExp)
eff_size(emRA, sigma = sigma(RAmodel),edf=31)
However, what I really want is to find the Cohen's d effect sizes of the main model so I might be able to make claims like "Exp has a bigger effect on RA than LastExp" or something like that. What I have in mind is to somehow get an output that looks a little like what I'm getting from:
car::Anova(RAmodel)
but include the Cohen's d in it. I tried to use the effsize package but I think the interaction in the model and non-numeric variables is making it difficult.
I apologize in advance if some of these lines don't work without the full dataset. I would appreciate any assistance in this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论