# MATH 6643 Summer 2012 Applications of Mixed Models/Students/smithce/Model1

(Difference between revisions)
 Revision as of 13:36, 28 May 2012 (view source)Smithce (Talk | contribs) (Created page with "=== Model 1 === Level 1 Model :$mathach_{ij} = {\color{Red}\beta_{0j}} + {\color{Blue}\beta_{1j}}ses_{ij} + r_{ij}$ Level 2 Model (Between School Model...")← Older edit Latest revision as of 14:27, 29 May 2012 (view source)Smithce (Talk | contribs) Line 87: Line 87: :1. $Var({\color{Red}u_{0}}) = 2.151^2$ :1. $Var({\color{Red}u_{0}}) = 2.151^2$ :2. $Var({\color{Blue}u_{1}}) = 0.355^2$ :2. $Var({\color{Blue}u_{1}}) = 0.355^2$ - :3. $Cov({\color{Red}u_{0}},{\color{Blue}u_{1}}) = 0.973$ + :3. $Correlation({\color{Red}u_{0}},{\color{Blue}u_{1}}) = 0.973$ :4. $Var({\color{Black}r_{ij}}) = 6.075^2$ :4. $Var({\color{Black}r_{ij}}) = 6.075^2$ :5 ${\color{Red}\gamma_{00}} = 13.98$ Intercept for Catholic schools :5 ${\color{Red}\gamma_{00}} = 13.98$ Intercept for Catholic schools

## Latest revision as of 14:27, 29 May 2012

### Model 1

Level 1 Model

$mathach_{ij} = {\color{Red}\beta_{0j}} + {\color{Blue}\beta_{1j}}ses_{ij} + r_{ij}$

Level 2 Model (Between School Model)

${\color{Red}\beta_{0j}} = {\color{Red}\gamma_{00}} + {\color{Red}\gamma_{01}Sector_j} + {\color{Red}u_{0j}}$
${\color{Blue}\beta_{1j}} = {\color{Blue}\gamma_{10}} + {\color{Blue}\gamma_{11}Sector_j} + {\color{Blue}u_{1j}}$

Combined Model (by substitution)

$mathach_{ij} = {\color{Red}\gamma_{00}} + {\color{Red}\gamma_{01}Sector_j} + {\color{Red}u_{0j}} + ({\color{Blue}\gamma_{10}} + {\color{Blue}\gamma_{11}Sector_j} + {\color{Blue}u_{1j}})ses_{ij} + r_{ij}$
$mathach_{ij} = \underbrace{{\color{Red}\gamma_{00}} + {\color{Red}\gamma_{01}Sector_j} + {\color{Blue}\gamma_{10}}ses_{ij} + {\color{Blue}\gamma_{11}Sector_j}ses_{ij}}_{Fixed} + \underbrace{{\color{Red}u_{0j}} + {\color{Blue}u_{1j}}ses_{ij} + r_{ij}}_{Random}$

Fixed Portion of the Model

${\color{Red}\gamma_{00}} + {\color{Red}\gamma_{01}}Sector_j + {\color{Blue}\gamma_{10}}ses_{ij} + {\color{Blue}\gamma_{11}}Sector_jses_{ij}$

Random Portion of the Model

${\color{Red}u_{0j}} + {\color{Blue}u_{1j}}ses_{ij} + r_{ij}$

fit <- lme( mathach ~ ses * Sector, dd, random = ~ 1 + ses | id, control = list(msMaxIter=200, msVerbose=T))
# Note that id refers to schools not students!


Linear mixed-effects model fit by REML
Data: dd

 AIC BIC logLik 23914 23964 -11949

Random effects:
Formula: ~1 + ses | id
Structure: General positive-definite, Log-Cholesky parametrization

 StdDev Corr (Intercept) 2.151 1 (Intr) ses 0.355 2 0.973 3 Residual 6.0754

Fixed effects: mathach ~ ses * Sector

 Value Std.Error DF t-value p-value (Intercept) 13.985 0.387 3602 36.1 0 ses 1.676 0.228 3602 7.3 0 SectorPublic -2.377 0.526 78 -4.5 0 ses:SectorPublic 1.398 0.307 3602 4.5 0

Correlation:

 (Intr) ses SctrPb ses 0.204 SectorPublic -0.736 -0.15 ses:SectorPublic -0.152 -0.744 0.252

Standardized Within-Group Residuals:

 Min Q1 Med Q3 Max -3.0761 -0.7378 0.0246 0.7565 2.7849

Number of Observations: 3684
Number of Groups: 80

Notes

1. $Var({\color{Red}u_{0}}) = 2.151^2$
2. $Var({\color{Blue}u_{1}}) = 0.355^2$
3. $Correlation({\color{Red}u_{0}},{\color{Blue}u_{1}}) = 0.973$
4. $Var({\color{Black}r_{ij}}) = 6.075^2$
5 ${\color{Red}\gamma_{00}} = 13.98$ Intercept for Catholic schools
6 ${\color{Blue}\gamma_{10}} = 1.67$ Slope of ses for Catholic schools
7 ${\color{Red}\gamma_{01}} = -2.37$ Change in Intercept for Public schools (e.g. Intercept for Public = 13.98 - 2.37 = 11.61)
8 ${\color{Blue}\gamma_{11}} = 1.39$ Change in Slope for Public schools (e.g. ses slope for Public = 1.67 + 1.39 = 3.06)