MATH 6643 Summer 2012 Applications of Mixed Models/Students/smithce/Model2

From Wiki1

Jump to: navigation, search
 
Line 149: Line 149:
:7 <math>{\color{Red}\gamma_{01}} = -1.779</math> Change in Intercept for Public schools (e.g. Intercept for Public = 13.809 -1.779 = 12.03)
:7 <math>{\color{Red}\gamma_{01}} = -1.779</math> Change in Intercept for Public schools (e.g. Intercept for Public = 13.809 -1.779 = 12.03)
:8 <math>{\color{Red}\gamma_{02}} = 3.091</math>  Increase in mathach associated with 1 unit increase in school mean ses - Contextual effect
:8 <math>{\color{Red}\gamma_{02}} = 3.091</math>  Increase in mathach associated with 1 unit increase in school mean ses - Contextual effect
-
:9 <math>{\color{Blue}\gamma_{11}} = 1.366</math>  Change in within-school effect for Public schools (e.g. ses slope for Public = 1.517 + 1.366 = 2.883)
+
:9 <math>{\color{Blue}\gamma_{11}} = 1.366</math>  Change in within-school effect for Public schools (e.g. ses slope for Public = 1.517 + 1.366 = 2.883).  Equivalent interpretation: The difference between the slope of Public schools compared to Catholic schools.
:10 <math>{\color{Blue}\gamma_{10}} + {\color{Red}\gamma_{02}}  = 1.517 + 3.091 = 4.608 </math> Between school effect for Catholic schools (e.g. This is the difference going from a student with ses = X in a school with mean ses = Y to a student with ses = X + 1 in a school with mean ses = Y + 1)
:10 <math>{\color{Blue}\gamma_{10}} + {\color{Red}\gamma_{02}}  = 1.517 + 3.091 = 4.608 </math> Between school effect for Catholic schools (e.g. This is the difference going from a student with ses = X in a school with mean ses = Y to a student with ses = X + 1 in a school with mean ses = Y + 1)
:11 Continued from 9.  Within school effect for Public Schools is <math>{\color{Blue}\gamma_{11}} + {\color{Blue}\gamma_{10}} =  1.366 + 1.517 </math>
:11 Continued from 9.  Within school effect for Public Schools is <math>{\color{Blue}\gamma_{11}} + {\color{Blue}\gamma_{10}} =  1.366 + 1.517 </math>

Latest revision as of 13:36, 29 May 2012

Model 2 with Contextual Variable

We can easily create a new variable, ses.m, which we assign the mean ses for the particular school the student is comes from:

dd$ses.m <- with( dd, cvar( ses, id))


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}\gamma_{02}ses.m_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}\gamma_{02}ses.m_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{Red}\gamma_{02}ses.m_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{Red}\gamma_{02}}ses.m_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}


fitc <- lme( mathach ~ ses * Sector + ses.m, dd, random = ~ 1 + ses | id )
# Note that id refers to schools not students!


Linear mixed-effects model fit by REML
Data: dd

AICBIClogLik
23891.8523947.74-11936.92


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

StdDevCorr
(Intercept)1.7761(Intr)
ses0.36520.6513
Residual6.0744


Fixed effects: mathach ~ ses * Sector + cvar(ses, id)

ValueStd.ErrorDFt-valuep-value
(Intercept)13.80950.332360241.5920.00E+00
ses1.51760.23136026.5640.00E+00
SectorPublic-1.77970.46477-3.8363.00E-04
ses.m3.09180.590775.2410.00E+00
ses:SectorPublic1.36690.305736024.4690.00E+00


Correlation:

(Intr)sesSctrPbcv(,i)
ses0.134
SectorPublic-0.733-0.126
ses.m-0.1-0.1830.238
ses:SectorPublic-0.088-0.7330.1720.011


Standardized Within-Group Residuals:

MinQ1MedQ3Max
-3.08703974-0.73427560.028545290.749822312.85516252


Number of Observations: 3684
Number of Groups: 80


L <- list( 'Effect of ses' = rbind(
"Within-school" =  c( 0,1,0,0,0),
"Contextual"    =  c( 0,0,0,1,0),
"Compositional" =  c( 0,1,0,1,0)))
wald ( fitc , L )


numDFdenDFF.valuep.value
Effect of ses27743.03857<.00001
EstimateStd.ErrorDFt-valuep-valueLower 0.95Upper 0.95
Within-school1.51760.23136026.564<.000011.0641.970
Contextual3.09180.590775.241<.000011.9174.265
Compositional4.608100.593777.776<.000013.4285.788


L <- list( "Within school effect of ses" =
rbind( "Catholic" = c(0,1,0,0,0),
"Public" = c(0,1,0,0,1),
"Pub-Cath" = c(0,0,0,0,1))
)


numDFdenDFF.valuep.value
Within school effect of ses23602114.536<.00001
EstimateStd.ErrorDFt-valuep-valueLower 0.95Upper 0.95
Catholic1.51760.23136026.564<.000011.0641.970
Public2.883110.208360213.855<.000012.4753.291
Pub-Cath1.36690.30636024.4691.00E-050.7671.965


Notes

1. Var({\color{Red}u_{0}}) = 1.776^2
2. Var({\color{Blue}u_{1}}) = 0.365^2
3. Cov({\color{Red}u_{0}},{\color{Blue}u_{1}}) = 0.651
4. Var({\color{Black}r_{ij}}) = 6.074^2
5 {\color{Red}\gamma_{00}} = 13.809 Intercept for Catholic schools
6 {\color{Blue}\gamma_{10}} = 1.517 Within school effect of ses for Catholic schools
7 {\color{Red}\gamma_{01}} = -1.779 Change in Intercept for Public schools (e.g. Intercept for Public = 13.809 -1.779 = 12.03)
8 {\color{Red}\gamma_{02}} = 3.091 Increase in mathach associated with 1 unit increase in school mean ses - Contextual effect
9 {\color{Blue}\gamma_{11}} = 1.366 Change in within-school effect for Public schools (e.g. ses slope for Public = 1.517 + 1.366 = 2.883). Equivalent interpretation: The difference between the slope of Public schools compared to Catholic schools.
10 {\color{Blue}\gamma_{10}} + {\color{Red}\gamma_{02}}  = 1.517 + 3.091 = 4.608 Between school effect for Catholic schools (e.g. This is the difference going from a student with ses = X in a school with mean ses = Y to a student with ses = X + 1 in a school with mean ses = Y + 1)
11 Continued from 9. Within school effect for Public Schools is {\color{Blue}\gamma_{11}} + {\color{Blue}\gamma_{10}} =  1.366 + 1.517
Personal tools