在 R 中设置方差分析的对比度 [英] Setting Contrasts for ANOVA in R

查看:41
本文介绍了在 R 中设置方差分析的对比度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近一直试图在 R 中对附加的数据框执行方差分析.

I've been attempting to perform an ANOVA in R recently on the attached data frame.

我的问题围绕着对比的设置.

My question revolves around the setting of contrasts.

我的设计是一个 3x5 的主题内设计.

My design is a 3x5 within-subjects design.

Circle1"下有 3 个视觉条件,Beep1"下有 5 个音频.

There are 3 visual conditions under 'Circle1' and 5 audio under 'Beep1'.

有谁知道我应该如何设置对比?这是我不熟悉的东西,因为我正在从 SPSS 中的点和点击统计过渡到 R 中编码.

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.

感谢您的时间

数据文件:

推荐答案

从另一个被标记为类似的 stackoverflow 问题,由于您没有提供任何代码,您可以先查看 R 中的对比包.正如他们在文档中所指出的:

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. As they note in the document:

"contrast 包的目的是提供一个标准化的接口,用于测试来自常见回归模型的参数的线性组合.语法模仿了对比.来自 Design 库的设计功能.这个包中的对比类已扩展为使用函数 lm、glm、gls、lme 和 geese 生成的线性模型."

"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."

Dr.威廉·金,他谈到了主题之间的阶乘方差分析,还包括了大量的 R 代码.这比您的问题范围更广,但将是一个很好的起点(只是为了获取上下文).

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. This is wider scoped than you question but would be a great place to start (just to get context).

最后,您可以参考另一个资源,讨论在 R 中设置正交对比.

Finally, here is another resource that you can refer to which talks about setting up orthogonal contrasts in R.

这篇关于在 R 中设置方差分析的对比度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆