UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

MLWin Textbook Examples
Multilevel Analysis by Tom Snijders and Roel Bosker
Chapter 6: Testing and Model Specification

Note that unless otherwise noted, we used IGLS estimation.
In this chapter we will be using the following centered variables: GndC_verb is iq_verb centered around the grand mean; GrpM_verb contains the group means of iq_verb; GrpMC_verb contains the group means of GndC_verb; GndC_ses is ses centered around the grand mean.
Furthermore, we will be creating the following centered variables: iq_tilde which is equal to gndc_verb - grpmc_verb.
From chapter 4 and 5: creating the variables constant, GndC_verb, GrpMC_verb and gndc_ses.
Creating the constant variable.
Data Manipulation  Names
  This opens up a window listing all the variables in the dataset with the 
  number of non-missing observations, missing observation, max and min for
  each variable.  We just need to find out the total number of observations
  in the dataset but this is a nice window to have open to keep an eye on 
  which variables have been corrected and do they look reasonable.
   Generate Vector
    For the output column choose an unused variable and rename it cons by 
    using ctrl+n which brings up a rename window.  Then enter the total 
    number of observations in the data set for number of copies, in this 
    case n=2287.  Finally, enter 1 for the value since this will be a constant 
    variable equal to 1.
     Click generate in order to execute the command
For more information, see the FAQ How do I include a constant in my model?
Calculating the grand mean for iq_verb and then creating the variable gndc_verb which is centered around the grand mean.
Basic Statistics
 Averages and Correlations
  Choose iq_verb and click on calculate.
Calculate 
 Choose an unused variable and rename it gndc_verb by using ctrl+n
 Enter "gndc_verb" = "iq_verb" - 11.834 and click on calculate.
Creating the variable grpmc_verb which contains the group means of gndc_verb.
Data Manipulation
 Multilevel Data Manipulation
  in the input column choose gndc_verb, in the output column choose an unused variable and use ctrl+N
  to rename it grpmc_verb then this will be the output variable
   Click Add to action list which will make the input and output choices appear in the action list
   on the right hand side
    Click on Execute
Calculating the grand mean for ses and then creating the variable gndc_ses which is centered around the grand mean.
Basic Statistics
 Averages and Correlations
  Choose ses and click on calculate.
Calculate 
 Choose an unused variable and rename it gndc_ses by using ctrl+n
 Enter "gndc_ses" = "ses" - 27.812 and click on calculate.
Creating iq_tilda which is equal to gndc_verb - grpmc_verb.
Calculate 
 Choose an unused variable and rename it iq_tilda by using ctrl+n
 Enter "iq_tilda" = "gndc_verb" - "grpmc_verb" and click on calculate.
Table 6.1, model 1, p. 71.
Random slope model including grpmc_verb and gndc_ses as a fixed effects and gndc_verb as a both a random slope and as a fixed effect.
Model
 Equations
  Click on Y
  Choose y: langpost, N levels: 2 - ij, level2(j): schoolnr, and 
  level1(i): pupilnr.
   Click on the x0 variable
   Choose the variable constant and select both schoolnr and pupilnr.
    Add Term
     Click on the x1 variable
     Choose gndc_verb as a fixed parameter and as a random slope with variance 
     at the j(schoolnr) level
      Add Term
       Click on the x2 variable         
       Choose gndc_ses as a fixed parameter
        Add Term
         Click on the x3 variable
         Choose grpmc_verb as a a fixed parameter
Click on the Start button located below the file menu and then click on estimates at the bottom of the equations window to make the estimates appear.
Table 6.1, model 2, p. 71.
Random slope model including grpmc_verb and gndc_ses as a fixed effects and iq_tilda as a both a random slope and as a fixed effect.
Model
 Equations
  Click on Y
  Choose y: langpost, N levels: 2 - ij, level2(j): schoolnr, and 
  level1(i): pupilnr.
   Click on the x0 variable
   Choose the variable constant and select both schoolnr and pupilnr.
    Add Term
     Click on the x1 variable
     Choose iq_tilda as a fixed parameter and as a random slope with variance 
     at the j(schoolnr) level
      Add Term
       Click on the x2 variable         
       Choose gndc_ses as a fixed parameter
        Add Term
         Click on the x3 variable
         Choose grpmc_verb as a a fixed parameter
Click on the Start button located below the file menu and then click on estimates at the bottom of the equations window to make the estimates appear.

How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California