Days
Days
\(y_i = \beta_0 + \beta_1 \times \text{Days}_i + b_{0~ij}\)
\(y_i = \beta_0 + \beta_1 \times \text{Days}_i + b_{0~ij} + b_{1~ij}\)
lme4
package in Rlme4
has a simple syntax lmer(Reaction ~ Days + (1 + Days|Subject), data = df)
Linear mixed model fit by REML ['lmerMod']
Formula: Reaction ~ Days + (1 + Days | Subject)
Data: dat
REML criterion at convergence: 1404.1
Scaled residuals:
Min 1Q Median 3Q Max
-4.0157 -0.3541 0.0069 0.4681 5.0732
Random effects:
Groups Name Variance Std.Dev. Corr
Subject (Intercept) 992.69 31.507
Days 45.77 6.766 -0.25
Residual 651.59 25.526
Number of obs: 144, groups: Subject, 18
Fixed effects:
Estimate Std. Error t value
(Intercept) 245.097 9.260 26.468
Days 11.435 1.845 6.197
Correlation of Fixed Effects:
(Intr)
Days -0.454