Sample Mplus code for Two-level HLM

Title: CULTURAL CAPITAL

Data:
File = CPTIMSS.TXT;
TYPE = IMPUTATION;
Variable:
Names are
IDSCHOOL IDSTUD
MATH PV1MAT PV2MAT PV3MAT PV4MAT PV5MAT
SCI PV1SCI PV2SCI PV3SCI PV4SCI PV5SCI
gender PINV SESST
PREADT PREAD PBOOK PEDU PEXP
schsiz disadv schlan popul
TOTWGT impute;

USEVARIABLES ARE
MATH gender PINV SESST
PREADT PREAD PBOOK PEDU PEXP
schsiz disadv schlan popul;

missing = all(9999.00,9999);

CLUSTER = IDSCHOOL;
WITHIN = gender PINV SESST
PREADT PREAD PBOOK PEDU PEXP;
BETWEEN = schsiz disadv schlan popul;
WEIGHT = TOTWGT;
DEFINE: CENTER PINV SESST PREADT PREAD PBOOK PEDU PEXP
schsiz disadv schlan popul (GRANDMEAN);

Analysis: type = TWOLEVEL RANDOM;
MODEL:
%WITHIN%
MATH ON gender PINV SESST PREADT PREAD PBOOK PEDU PEXP;

%BETWEEN%
MATH ON schsiz disadv schlan popul;