在 R 中没有复制就无法计算出双因素方差分析
我尝试使用 manova() ,但似乎无法获得正确的编程。我尝试了这种方式(在另一篇文章中):
R 错误消息中的 manova:'dimnames' 的长度 [1] 不等于数组范围
文本问题与踏板旋转和初始速度作为加速度的预测因素有关。
这是数据:
acc <- data.frame(Degrees = c("d5","d8","d10"), MPH10=c(0.35, 0.37, 0.32),
MPH25=c(0.19, 0.28, 0.30), MPH40=c(0.14, 0.19, 0.29), MPH55=c(0.10, 0.19, 0.23))
ACC
acc
Degrees MPH10 MPH25 MPH40 MPH55
1 5 0.35 0.19 0.14 0.10
2 8 0.37 0.28 0.19 0.19
3 10 0.32 0.30 0.29 0.23
不知道下一步该做什么。
I tried using manova() and can not seem to get the correct programming in. I tried it this way (in a different post):
manova in R error message: length of 'dimnames' [1] not equal to array extent
the text question has to do with pedal rotation and initial speed being predictors of acceleration.
here is that data:
acc <- data.frame(Degrees = c("d5","d8","d10"), MPH10=c(0.35, 0.37, 0.32),
MPH25=c(0.19, 0.28, 0.30), MPH40=c(0.14, 0.19, 0.29), MPH55=c(0.10, 0.19, 0.23))
acc
acc
Degrees MPH10 MPH25 MPH40 MPH55
1 5 0.35 0.19 0.14 0.10
2 8 0.37 0.28 0.19 0.19
3 10 0.32 0.30 0.29 0.23
no idea what to do next.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
传统的答案是:
剩下的就是构建对结果的正确描述。 (请注意,我使用“+”而不是“*”)。使用交互模型构建饱和模型(没有残差的模型)时,您会得到近乎完美的答案:
您可以将 Degrees 或 MPH 变量中的一个或两个编码为数字并获得不饱和模型。但它仍然会添加到描述结果的复杂性。
使用 sub 从字符变量中删除“MPH”。我认为有必要对我认为是因子变量的内容使用
as.numeric(as.character())
,但sub
操作显然剥离了该因子属性并仅使用as.numeric
就足够了。The conventional answer would be:
And all that remains is constructing a proper description of the results. (Notice that I used "+" instead of "*"). You get a nearly perfect answer when constructing a saturated model (one with no residuals) when using the interaction model:
You could have coded either or both of Degrees or MPH variables as numeric and gotten an unsaturated model.But it would still have added to the complexity of describing the result.
Using sub to remove the "MPH" from the character variables. I thought it would be necessary to use
as.numeric(as.character())
on what I thought would be a factor variable, but thesub
operation apparently stripped the factor attribute and just usingas.numeric
was sufficient.