简体   繁体   English

在 R 中设置方差分析的对比度

[英]Setting Contrasts for ANOVA in R

I've been attempting to perform an ANOVA in R recently on the attached data frame.我最近一直在尝试在 R 中对附加的数据框执行方差分析。

My question revolves around the setting of contrasts.我的问题围绕着对比的设置。

My design is a 3x5 within-subjects design.我的设计是一个 3x5 的主题内设计。

There are 3 visual conditions under 'Circle1' and 5 audio under 'Beep1'. “Circle1”下有 3 个视觉条件,“Beep1”下有 5 个音频。

Does anyone have any idea how I should set the contrasts?有谁知道我应该如何设置对比? This is something I'm unfamiliar with as I'm making the transition from point and click stats in SPSS to coded in R.这是我不熟悉的东西,因为我正在从 SPSS 中的点和点击统计过渡到用 R 编码。

Thanks for your time谢谢你的时间

Data file:数据文件:

Reiterating my answer from another stackoverflow question that was flagged as similar , since you didn't provide any code, you might start by having a look at the contrast package in R .重申我从另一个标记为 similar 的 stackoverflow 问题中的回答,由于您没有提供任何代码,您可以先查看R中的对比包 As they note in the document:正如他们在文件中指出的那样:

"The purpose of the contrast package is to provide a standardized interface for testing linear combinations of parameters from common regression models. The syntax mimics the contrast. Design function from the Design library. The contrast class has been extended in this package to linear models produced using the functions lm, glm, gls, lme and geese." “对比包的目的是提供一个标准化的接口,用于测试来自常见回归模型的参数的线性组合。语法模仿对比。来自设计库的设计功能。对比类已在此包中扩展到生成的线性模型使用函数 lm、glm、gls、lme 和 geese。”

There is also a nice little tutorial here by Dr. William King who talks about factorial between subjects ANOVA and also includes an abundance of R code.这里还有一个不错的小教程,由William King 博士撰写,他讨论了主题 ANOVA 之间的阶乘,还包括大量 R 代码。 This is wider scoped than you question but would be a great place to start (just to get context).这比您的问题范围更广,但将是一个很好的起点(只是为了获得上下文)。

Finally, here is another resource that you can refer to which talks about setting up orthogonal contrasts in R .最后,这是您可以参考的另一个资源,它讨论了在 R 中设置正交对比

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM