如何编写线性混合效应模型的差分公式(使用 lmertest 或 lme4)?
我有一个训练数据集:
$ NUM_DEVICE_ID_COUPON : Factor w/ 9 levels "8647","8666",..: 3 4 5 8 9 1 2 3 4 6 ...
$ TEMPERATURE_AIR : num 6.29 6.13 6 7.05 8.16 ...
$ MonthNumber : Factor w/ 12 levels "1","2","3","4",..: 10 10 10 10 10 10 10 1
$ HOURS : Factor w/ 24 levels "0","1","2","3",..: 7 7 7 7 7 8 8 8 8 8 .
$ TEMPERATURE_COUPON : num 5.1 6.6 4.5 5.4 4.7 ...
我最好的方差分析模型是变量的交互:
lm(TEMPERATURE_COUPON ~ TEMPERATURE_AIR * MonthNumber * HOURS, ...)
所以现在我想通过使用线性混合效应模型(NUM_DEVICE_ID_COUPON)来改进我的模型。
我想研究 NUM_DEVICE_ID_COUPON 的所有随机效应,包括截距和协变量。 但我不确定是否正确写出公式并理解它。
这些公式有价值吗?
无截距 + 斜率的模型:
lmerTest::lmer(TEMPERATURE_COUPON ~ TEMPERATURE_AIR * MonthNumber * HOURS +
(1 + TEMPERATURE_AIR | NUM_DEVICE_ID_COUPON) +
(1 + MonthNumber | NUM_DEVICE_ID_COUPON) +
(1 + HOURS | NUM_DEVICE_ID_COUPON) +
有截距 + 斜率的模型:
merTest::lmer(TEMPERATURE_COUPON ~ TEMPERATURE_AIR * MonthNumber * HOURS +
(0 + TEMPERATURE_AIR | NUM_DEVICE_ID_COUPON) +
(0 + MonthNumber | NUM_DEVICE_ID_COUPON) +
(0 + HOURS | NUM_DEVICE_ID_COUPON) +
请问我还可以测试哪些其他公式?
谢谢。 泰奥.
I have a training dataset with:
$ NUM_DEVICE_ID_COUPON : Factor w/ 9 levels "8647","8666",..: 3 4 5 8 9 1 2 3 4 6 ...
$ TEMPERATURE_AIR : num 6.29 6.13 6 7.05 8.16 ...
$ MonthNumber : Factor w/ 12 levels "1","2","3","4",..: 10 10 10 10 10 10 10 1
$ HOURS : Factor w/ 24 levels "0","1","2","3",..: 7 7 7 7 7 8 8 8 8 8 .
$ TEMPERATURE_COUPON : num 5.1 6.6 4.5 5.4 4.7 ...
My best ANOVA model is with interactions on variables :
lm(TEMPERATURE_COUPON ~ TEMPERATURE_AIR * MonthNumber * HOURS, ...)
So now I want to improve my model by using Linear Mixed Effects Models (NUM_DEVICE_ID_COUPON).
I want to study all randoms effects for NUM_DEVICE_ID_COUPON, both for intercept and the covariables.
But I'm not sure to correctly write the formula and understand it.
Are theses formula valables?
Model without intercept + slope :
lmerTest::lmer(TEMPERATURE_COUPON ~ TEMPERATURE_AIR * MonthNumber * HOURS +
(1 + TEMPERATURE_AIR | NUM_DEVICE_ID_COUPON) +
(1 + MonthNumber | NUM_DEVICE_ID_COUPON) +
(1 + HOURS | NUM_DEVICE_ID_COUPON) +
Model with intercept + slope :
merTest::lmer(TEMPERATURE_COUPON ~ TEMPERATURE_AIR * MonthNumber * HOURS +
(0 + TEMPERATURE_AIR | NUM_DEVICE_ID_COUPON) +
(0 + MonthNumber | NUM_DEVICE_ID_COUPON) +
(0 + HOURS | NUM_DEVICE_ID_COUPON) +
What additional formulas can I test please?
Thanks.
Théo.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论