This is part 1 of 2 tutorials on mixed effects models. Part 2 is entitled Fixed and Random Effects Model (Part 2 of 2 Mixed Effect Model).
In this tutorial we give a trivial example of determining if the pitch of voice can be partly determined by sex. i.e.
\[pitch \sim sex\]
Since sex does not fully determine pitch we summarize the other effects as epsilon, \(\varepsilon\) i.e.
\[pitch \sim sex + \varepsilon\]
pitch = c(233,204,242,130,112,142)
sex = c(rep("female",3),rep("male",3))
pitch_sex_df = data.frame(sex,pitch)
pitch_sex_lm = lm(pitch~sex,pitch_sex_df)
summary(pitch_sex_lm)
##
## Call:
## lm(formula = pitch ~ sex, data = pitch_sex_df)
##
## Residuals:
## 1 2 3 4 5 6
## 6.667 -22.333 15.667 2.000 -16.000 14.000
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 226.33 10.18 22.224 2.43e-05 ***
## sexmale -98.33 14.40 -6.827 0.00241 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 17.64 on 4 degrees of freedom
## Multiple R-squared: 0.921, Adjusted R-squared: 0.9012
## F-statistic: 46.61 on 1 and 4 DF, p-value: 0.002407
A Multiple Regression Model is a linear model where one predictor has many predictors variable (fixed effects). Such as: \[pitch \sim sex + age + language + ... + \varepsilon\]
hist() or qqnorm()dfbeta()Example adapted from Bodo Winter of the University of California:
Winter, B. (2013). Linear models and linear mixed effects models in R with linguistic applications. arXiv:1308.5499. [http://arxiv.org/pdf/1308.5499.pdf]