Multilevel Modeling Using HLM and MLwiN Xiao Chen UCLA Academic Technology Services Hierarchical Data Structure Organizational studies Students nested in schools and variables are measured at both student level and school level Repeated measures Multiple observations are collected over time on each person Doubly nested Multiple observations are nested in individuals and individuals are nested within organizations Statistical Treatment of Clustered Data Aggregation Moving variables from student level to school level Shift of meaning Ecological fallacy Relationships observed for groups necessarily hold for individuals Neglecting the original data structure Disaggregation Moving variables from school level to student level Both macro level and micro level variables exist in the model Data has only micro level variables What can Multilevel Modeling do? Improving estimation of effects within individual units Hypotheses testing about cross-level effects Partitioning of variance and covariance components among levels Overview of HLM and MLwiN HLM Under development since mid 1980’s First window version came out in 1997 Version 6 in September 2004 Run on Windows 95/98/NT/Me/2000/XP Minimum 2 MB of RAM and 2 MB of disk space MLwiN Based on MLn First released in 1997 Version 2 in 2004 Run on Windows 95/98/NT/Me/2000/XP 32 Mb of Ram or more A hard disk with at least 20MB of available space Continued HLM Graphical interface Continuous outcome Binary, count outcome Multivariate outcome variables Cross-classified data Sample weights Number of levels: 3 MLwiN Graphical interface Continuous outcome Binary, count outcome Multivariate outcome variables Cross-classified data Sample weights Number of levels: can be many (default is 5) Data Format for Multilevel Analysis Inputting Data HLM Use a level-1 data set and a level-2 data set for creating an .mdm file (mdmt stands for multivariate data matrix) Read SAS, SPSS, STATA and SYSTAT files directly Built-in Stat/transfer for many different data types Use mdm file for computation, very efficient Use raw data sets for graphics MLwiN One single file ASCII file Native MLwiN format (.ws extension) Stata2mlwin program for stata users Set-up the size of worksheet (memory control) Data Management HLM Length of a variable name is 8 No data management Predictor variables can be either grand-mean centered or group-mean centered Cross-level interaction is naturally built Summary statistics created when .mdm file is created MLwiN Can create new variables Categorical variables can be dummied automatically Summary statistics Cross-level interaction variable has to be created before building up a model HLM: Multilevel Model Approach MLwiN: Mixed Model Approach Output From HLM Output from MLwiN Graphics for Exploring Data: HLM (Data-based graphs): line plots, scatter plots, and box plots 27.49 SECTOR = 0 SECTOR = 1 12.19 4.54 26.38 -3.12 SECTOR = 0 SECTOR = 1 0 12.00 18.73 MATHACH MATHACH 19.84 11.08 3.43 -4.22 -1.82 -0.94 -0.07 SES 0.80 1.67 Graphs for Exploring the Model: HLM (Model-based graphs) 20.89 MEANSES: low er MEANSES: mid 50% MEANSES: upper 13.85 10.33 6.82 0 3.00 6.00 9.00 21.40 12.00 MEANSES: low er ha MEANSES: upper ha 17.46 MATHACH INTERCEPT 17.37 13.53 9.59 5.65 -3.00 -1.66 -0.32 SES 1.03 Graphics for Exploring Data: MLwiN Graphs for Exploring the Model: MLwiN (Model-based graphs) Reference and Site(s) Ming Yang, Review of HLM 5.04 for Windows: http://multilevel.ioe.ac.uk/softrev/reviewhlm5.pdf Andy Jones, A review of random effects models in MLwiN (version 2.0): http://multilevel.ioe.ac.uk/softrev/reviewmlwin.pdf MLwiN 2 user’s manual: http://multilevel.ioe.ac.uk/download/userman20.pdf Goldstein, Tutorial in Biostatistics Multilevel modeling of medical data http://media.wiley.com/product_data/excerpt/08/0470023 7/0470023708.pdf Singer and Willett: Applied Longitudinal Data Analysis: Modeling Change and Event Occurrence: http://gseacademic.harvard.edu/~alda/ http://www.ats.ucla.edu/stat/