Note that unless otherwise noted, we used IGLS estimation.

In this chapter we will be using the following centered variables:GndC_verbisiq_verbcentered around the grand mean;GrpM_verbcontains the group means ofiq_verb;GrpMC_verbcontains the group means ofGndC_verb. Furthermore, we will be creating the following centered variables:GrpC_sizewhich is the group centered variable forgroupsiz;GndC_sesissescentered around the grand mean;verbXgsizewhich is the interaction ofGndC_verbandGndC_gsize.

From chapter 4: creating the variablesconstant,GndC_verbandGrpMC_verb.

Creating the constant variable.

Data Manipulation NamesThis 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 VectorFor 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. Clickgeneratein order to execute the command

Calculating the grand mean for

iq_verband then creating the variablegndc_verbwhich is centered around the grand mean.

Basic Statistics Averages and CorrelationsChooseiq_verband click oncalculate.

CalculateChoose an unused variable and rename itgndc_verbby using ctrl+n Enter "gndc_verb" = "iq_verb" - 11.834 and click on calculate.

Creating the variable

grpmc_verbwhich contains the group means ofgndc_verb.

Data Manipulation Multilevel Data Manipulationin the input column choosegndc_verb, in the output column choose an unused variable and use ctrl+N to rename itgrpmc_verbthen this will be the output variable ClickAdd to action listwhich will make the input and output choices appear in the action list on the right hand side Click onExecute

Table 5.1, p. 71.

Random slope model includinggrpmc_verbas a fixed effect andgndc_verbas a both a random slope and as a fixed effect.

Model EquationsClick onYChoose y:langpost, N levels: 2 - ij, level2(j):schoolnr, and level1(i):pupilnr. Click on thexChoose the variable_{0}variableconstantand select bothschoolnrandpupilnr.Add TermClick on thexChoose_{1}variablegrpmc_verbas a fixed parameterAdd TermClick on thexChoose_{2}variablegndc_verbas a fixed parameter and as a random slope with variance at the j(schoolnr) level

Click on the

Startbutton located below the file menu and then click onestimatesat the bottom of the equations window to make the estimates appear.

Generate the predicted values from the model in table 5.1 and storing them in the variable

pred.

Model Predictionsin the field calledoutput from prediction tochoosepredClick onNameto see the names of the variables in the model Click onconstant,grpmc_verbandgndc_verbwhich will make all the parameters in the model appear in black Click on the level 1 error term to make it grey since we do not want to model this error term Click onCalcto generate the predicted values and store them in the variablepred

Fig. 5.2, p. 79.

This graph shows the regression lines for all the schools, not just for 15 randomly chosen schools, by plotting the predicted valuespredbygndc_verb.

Graphs Customised Graph(s)in the field calledychoosepred, forxchoosegndc_verb, forgroupchooseschoolnr, and forplot typechoose line ClickApplyto generate the graph

Creating the variable

gndc_gsizewhich isgroupsizcentered around the grand mean andverbXgsizewhich is the interaction ofgndc_gsizeandgndc_verb.

CalculateChoose an unused variable and rename itgndc_gsizeby using ctrl+n Enter "gndc_gsize" = "groupsiz" - 23.1 and click on calculate Clear the equation window Choose an unused variable and rename itverbXgsizeby using ctrl+n Enter "verbXgsize" = "gndc_verb"*"gndc_gsize" and click on calculate

Table 5.2, p. 75.

Model with random slopes and cross-level interactions.

Model EquationsClick onYChoose y:langpost, N levels: 2 - ij, level2(j):schoolnr, and level1(i):pupilnr. Click on thexChoose the variable_{0}variableconstantand select bothschoolnrandpupilnr.Add TermClick on thexChoose_{1}variablegrpmc_verbas a fixed parameterAdd TermClick on thexChoose_{2}variablegndc_verbas a fixed parameter and as a random slope with variance at the j(schoolnr) levelAdd TermClick on thexChoose_{3}variablegndc_gsizeas a fixed parameterAdd TermClick on thexChoose_{4}variableverbXgsizeas a fixed parameter

Click on the

Startbutton located below the file menu and then click onestimatesat the bottom of the equations window to make the estimates appear.

Page 77, table 5.3 (skipped for now)

Calculating the grand mean for

sesand then creating the variablegndc_seswhich is centered around the grand mean.

Basic Statistics Averages and CorrelationsChoosesesand click oncalculate.

CalculateChoose an unused variable and rename itgndc_sesby using ctrl+n Enter "gndc_ses" = "ses" - 27.812 and click on calculate.

Creating the variable

verbXcombwhich is the interaction ofgndc_verbandcomb.

CalculateChoose an unused variable and rename itverbXcombby using ctrl+n Enter "verbXcomb" = "gndc_verb"*"comb" and click on calculate.

Table 5.4, p. 78

The smaller and more parsimonious model including a random slope and many fixed effects.

Model EquationsClick onYChoose y:langpost, N levels: 2 - ij, level2(j):schoolnr, and level1(i):pupilnr. Click on thexChoose the variable_{0}variableconstantand select bothschoolnrandpupilnr.Add TermClick on thexChoose_{1}variablegrpmc_verbas a fixed parameterAdd TermClick on thexChoose_{2}variablegndc_verbas a fixed parameter and as a random slope with variance at the j(schoolnr) levelAdd TermClick on thexChoose_{3}variablegndc_sesas a fixed parameterAdd TermClick on thexChoose_{4}variablecombas a fixed parameterAdd TermClick on thexChoose_{5}variableverbXcombas a fixed parameter

Click on the

Startbutton located below the file menu and then click onestimatesat the bottom of the equations window to make the estimates appear.

Page 84, table 5.5 (we don’t have the data for this example)