简体   繁体   English

嵌套在R中的3种方差分析

[英]3 way anova nested in r

I'm trying to figure out the model for a fully factorial experiment. 我正在尝试为完全析因实验找出模型。

I have the following factors 我有以下因素

Treatment   Day   Hour  Subject   ResponseVariable

10 days of measurements, 4 different time points within each day, 2 different treatments measured, 12 subjects )6 subjects within treatment 1, and 6 different subjects in treatment 2) 10天的测量,每天4个不同的时间点,测量的2种不同的治疗,12位受试者)治疗1中的6位受试者和治疗2中的6位不同受试者)

for each day I measured: 6 subjects in treatment 1, the other 6 in treatment 2, at 4 different time points. 我测量的每一天:治疗1中的6名受试者,治疗2中的其他6名受试者,分别在4个不同的时间点。
For Subjects, I have 12 different subjects, but Subjects 1-6 are in Treatment-1 and Subjects 7-12 are in Treatment-2. 对于受试者,我有12个不同的受试者,但是受试者1-6在治疗1中,而受试者7-12在治疗2中。 The subjects did not change treatments, thus I measured the same set of subjects for each treatment each of the 10 days 受试者没有改变治疗方法,因此我在10天中的每一天都对同一组受试者进行了测量

So what's tripping me up is specifying the correct error term. 因此,令我震惊的是指定正确的错误项。
I thought I had the general model down but R is giving me "Error() model is singular" 我以为我的通用模型不好了,但是R给我"Error() model is singular"

aov(ResponseVariable  ~ T + R + S + TR + TS + RS + Error(T/S)

any thoughts would help? 有什么想法会有所帮助吗?

I've gotten the same error, and I think my problem was missing observations. 我遇到了同样的错误,我认为我的问题是缺少观察结果。 Are you missing any observations? 您是否缺少任何观察? I believe they're less of a problem for linear mixed effects, and I've read that some people use lme instead of repeated-measures ANOVA for those cases. 我相信它们对于线性混合效果的影响较小,而且我读到有些人在这种情况下使用lme而不是重复测量方差分析。

Your error term can be interpreted as "the S effect within each T". 您的错误术语可以解释为“每个T内的S效应”。 It sounds from your description as though that's what you want, so I don't think that's what's causing your error message. 从您的描述中听起来好像是您想要的,所以我认为这不是导致您出现错误消息的原因。

One note: I see you've got a variable named "T". 注意:我看到您有一个名为“ T”的变量。 R let you do that? R让你这样做吗? T is normally reserved for meaning "TRUE". T通常保留用于表示“ TRUE”。 That might be part of your problem. 那可能是您问题的一部分。

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

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