160 likes | 282 Views
Multilevel Modeling Programs. David A. Kenny. Presumed Background. Multilevel Modeling Nested. Example Kashy (1991) Study of Gender and Intimacy respondents completed a survey each night for two weeks
E N D
Multilevel Modeling Programs David A. Kenny
Presumed Background • Multilevel Modeling • Nested
Example • Kashy (1991) Study of Gender and Intimacy • respondents completed a survey each night for two weeks • outcome is the average intimacy rating of each interaction partner(from 1 to 7, bigger numbers more intimacy) • Levels • level 1: intimacy of the interaction (1-7), partner gender (-1=male; 1=female) • level 2: respondent gender (-1=male; 1=female)
Syntax MIXED intimacy WITH resp_gender partner_gender /FIXED = resp_gender partner_gender resp_gender*partner_gender /PRINT = SOLUTION TESTCOV /RANDOM INTERCEPT partner_gender | SUBJECT(id) COVTYPE(UNR).
Output from Other Programs HLM SAS R: lmer MLwiN not included: Stata
SAS: Syntax PROC MIXED COVTEST; CLASS ID; MODEL INTIMACY = Part_Gen Resp_Gen Resp_Gen*Part_Gen / DDFM=SATTERTH SOLUTION; RANDOM INTERCEPT Part_Gen / TYPE=UN SUB=ID ; RUN; QUIT;
SAS: Output
library(foreign);library(lme4);library(lmerTest) ifilename="c:/kashy.sav" OrDa = read.spss (ifilename,use.value.labels=FALSE,max.value.labels=Inf,to.data.frame=TRUE) OrDa$int= OrDa$resp_gender*OrDa$partner_gender model <- lmer(intimacy ~ 1 + resp_gender + partner_gender + int + (partner_gender|id), data=OrDa) modelA <- lmer(intimacy ~ 1 + resp_gender + partner_gender + int + ((1)|id) + (0+partner_gender|id), data=OrDa) modelB <- lmer(intimacy ~ 1 + resp_gender + partner_gender + int + ((1)|id), data=OrDa) model anova(model) anova(model,modelB) anova(modelA,modelB) R: lmer
REML criterion at convergence: 5181.537 Random effects: Groups Name Std.Dev. Corr id (Intercept) 0.9236 partner_gender 0.1444 -0.12 Residual 1.3751 Analysis of Variance Table of type 3 with Satterthwaite approximation for degrees of freedom Df Sum Sq Mean Sq F value Denom Pr(>F) resp_gender 1 9.1697 9.1697 5.0353 77.372 0.0276940 * partner_gender 1 0.4822 0.4822 1.3104 77.166 0.2558666 int 1 30.0729 30.0729 15.9047 77.166 0.0001503 *** --- Df logLik deviance Chisq Chi Df Pr(>Chisq) ..1 6 -2584.5 5168.9 object 7 -2584.0 5168.0 0.9498 1 0.3298 R: lmer
More Webinars References Growth Curve Repeated Measures Two-Intercept Model Crossed Design Other Topics