使用lmer修正R中的模型 [英] Correct model in R using lmer

查看:198
本文介绍了使用lmer修正R中的模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对使用lmer在R中正确的模型设置有疑问.

I have a question regarding the correct model setup in R using lmer.

这是重复测量实验

每个受试者(总共20名)针对每种刺激条件(阳极,阴极和假手术)完成了4个不同的任务.因变量是反应时间(rt)

Each subject (20 in total) completed 4 different task for each stimulation condition (anode, cathode, and sham). The dependent variable is reaction times (rt)

我使用了此模型,但不确定其是否正确.我更担心随机效应是否正确分配

I used this model but I am not sure if its correct. I am more concerned if the random effects are correctly assigned

model<- lmer(rt ~ task * stimulation + (task * stimulation|subject), data=dat)

任何帮助将不胜感激.

谢谢

推荐答案

我不得不不同意引用Barr等人(2013年)保持最大"的其他答案.事实证明,这在很多情况下都是不好的建议,以至于lme4的作者引入了代码来检查奇异拟合.不仅如此,道格·贝茨(Doug Bates(lme4的主要作者,并且可能是世界上混合模型的主要权威))及其同事在2015年写了一篇论文,专门解决了最大程度地保留"的愿望所带来的问题. -简约混合模型.

I have to disagree with the other answer that quotes Barr et al (2013) to "keep it maximal". This has been proven to be bad advice on so many occasions that the authors of lme4 had introduce code to check for singular fit. Not only that but Doug Bates (primary author of lme4 and probably the worlds leading authority on mixed models) and colleagues wrote a paper in 2015 specifically adressing problems brought about by the wish to "keep it maximal" - Parsimonious Mixed Models.

当然,我并不是说检查奇异的配合是一件坏事-这是一件好事,因此肯定会带来一些好处.

Of course I am not saying that checking for singular fits is a bad thing - it's a great thing, so something good certainly came from it.

因此,在这种情况下,我们有(task * stimulation|subject),其中task具有4个级别,而stimulation具有3个级别,因此我们要求该软件仅对20个对象估计8个方差-协方差参数.我并不是说这是不可能的,但是对于我来说,将其作为目标似乎很奇怪. Bates等人(2015)的论文详细介绍了如何处理所产生的问题,我已经就CV回答了一些有关如何处理问题的问题此处

So in this case we have (task * stimulation|subject) where task has 4 levels and stimulation has 3 so we are asking the software to estimate 8 variance-covariance parameters with only 20 subjects. I am not saying that this is impossible, but it just seems bizarre to me for this to be the goal. The Bates et al (2015) paper goes into considerable detail about how to handle the resulting problems and I have answered some questions on CV about how to do so here and here

因此,总而言之,另一个答案不一定是错误的,但它可能导致很多问题.

So in summary, the other answer isn't necessarily wrong, but it can lead to a lot of problems.

这篇关于使用lmer修正R中的模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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