全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SPSS论坛
2723 2
2014-04-15

The lme4 package in R includes the cake dataset.


library(lme4)head(cake[,2:4], 20)   

        recipe temperature angle

1       A         175    42
2       A         185    46
3       A         195    47
4       A         205    39
5       A         215    53
6       A         225    42
7       B         175    39
8       B         185    46
9       B         195    51
10      B         205    49
11      B         215    55
12      B         225    42
13      C         175    46
14      C         185    44
15      C         195    45
16      C         205    46
17      C         215    48
18      C         225    63
19      A         175    47
20      A         185    29


I've analysed the cake dataset using two different models below. The first model is a 2 factor ANOVA:

summary(aov(angle ~ temperature + recipe, cake)) T[backcolor=rgba(252, 251, 248, 0.901961)]he second is a mixed effects model, with[backcolor=rgba(252, 251, 248, 0.901961)] temperature[backcolor=rgba(252, 251, 248, 0.901961)] [backcolor=rgba(252, 251, 248, 0.901961)]as a random effect:lmer(angle ~ recipe + (1| temperature), data=cake, REML=F)

Is someone able to provide a summary of what the mixed effect model has done differently to the ANOVA?




二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2014-4-15 01:21:03
I'm absolutely not a specialist, but this is my contribution:

In your ANOVA model, you treated both 'recipe' and 'temperature' as fixed factors, which can be thought of in terms of differences.

In your linear mixed model, you treated 'temperature' as a random factor, which is defined by a distribution and whose values are assumed to be chosen from a population with a normal distribution with a certain variance. It turns out that the corresponding output is now an estimate of this variance (line labeled 'temperature' in the Random effects section). And you can notice that the output for the 'recipe' is indeed an estimate for mean-differences (lines labeled recipeB and recipeC in the Fixed effects section).
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-4-15 01:27:02
Very briefly: In a two factor ANOVA (or, more generally, in a model that can be analyzed with lm in R) variables are controlled for. That is, it asks "Holding other independent variables constant, what is the linear relationship of each independent variable with the dependent variable?" Such models have a number of assumptions, key here is that they assume that the errors (as estimated by the residuals) are independent. Often, this is reasonable; also, often, it is not. In the cake data set it is not, because each recipe is tested multiple times, and surely the errors from the model will be more similar within each recipe than across recipes.

Mixed models relax this assumption.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群