[英]Repeated Measures Anova in R (Mixed Model?)
I have a data set that I am trying to analyze across both JMP and R that contains 4 columns and 468 rows. 我有一个试图跨JMP和R进行分析的数据集,其中包含4列和468行。
ID Treatment Time Response
H1 T 10 28
H1 T 20 0
H1 T 30 0
H1 T 40 0
H1 Y 10 12
H1 Y 20 5
H1 Y 30 24
H1 Y 40 28
H2 T 10 4
H2 T 20 12
H2 T 30 4
H2 T 40 0
H2 Y 10 44
H2 Y 20 12
H2 Y 30 23
H2 Y 40 11
My full data set contains 13 subjects (represented by ID) each that receive two treatments and are measured 18 times. 我的完整数据集包含13位受试者(用ID表示),每位受试者接受两次治疗并被测量18次。 I am trying to figure out the best way to run a repeated measures analysis on this data. 我正在尝试找出对这些数据进行重复测量分析的最佳方法。
I was using the formula am1 <- aov(Response ~ Treatment + (ID/Time), data = df)
but my degrees of freedom appeared off to my colleague so I ask your help on the best approach to go about this problem. 我使用的公式是am1 <- aov(Response ~ Treatment + (ID/Time), data = df)
但是我的同事对我却显示了自由度,因此我想请您寻求最佳方法来解决此问题。 I have my data set up for a univariate approach I believe but any help is appreciated. 我相信我的数据是针对单变量方法设置的,但是可以提供任何帮助。 Thanks 谢谢
假设您的数据是平衡的,则可以在公式中指定一个Error
项,这是?aov中的示例:
npk.aovE <- aov(yield ~ N*P*K + Error(block), npk)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.