examples from singer’s using sas proc mixed to fit multilevel models…

12
Examples from Singer’s Using SAS Proc Mixed to Fit Examples from Singer’s Using SAS Proc Mixed to Fit Multilevel Models… Multilevel Models… To use the paper effectively, … in To use the paper effectively, … in particular the reader must understand: particular the reader must understand: The difference between a fixed effect and The difference between a fixed effect and a random effect a random effect The notion of multiple levels with a The notion of multiple levels with a hierarchy hierarchy The notion that error variance-covariance The notion that error variance-covariance matrix can take on different structures matrix can take on different structures That centering can be a helpful way of That centering can be a helpful way of parameterizing the models so that the parameterizing the models so that the results are more easily interpreted” results are more easily interpreted”

Upload: axel-townsend

Post on 31-Dec-2015

38 views

Category:

Documents


3 download

DESCRIPTION

Examples from Singer’s Using SAS Proc Mixed to Fit Multilevel Models…. “ To use the paper effectively, … in particular the reader must understand: The difference between a fixed effect and a random effect The notion of multiple levels with a hierarchy - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Examples from Singer’s Using SAS Proc Mixed to Fit Multilevel Models…

Examples from Singer’s Using SAS Proc Mixed to Fit Multilevel Models…Examples from Singer’s Using SAS Proc Mixed to Fit Multilevel Models…

““To use the paper effectively, … in particular the reader To use the paper effectively, … in particular the reader must understand: must understand:

The difference between a fixed effect and a random The difference between a fixed effect and a random effecteffect

The notion of multiple levels with a hierarchyThe notion of multiple levels with a hierarchy

The notion that error variance-covariance matrix can The notion that error variance-covariance matrix can take on different structurestake on different structures

That centering can be a helpful way of parameterizing That centering can be a helpful way of parameterizing the models so that the results are more easily the models so that the results are more easily interpreted”interpreted”

Page 2: Examples from Singer’s Using SAS Proc Mixed to Fit Multilevel Models…

Example 1 in HLM: Unconditional Means ModelExample 1 in HLM: Unconditional Means Model

Focus on showing how to make .mdm file based on a single Stata fileFocus on showing how to make .mdm file based on a single Stata fileDecomposition of variance into between and within varianceDecomposition of variance into between and within varianceIntraclass correlationIntraclass correlationExploring the data graphically: Exploring the data graphically:

FileFileGraph DataGraph Databox-whisker plots (outcome variable)box-whisker plots (outcome variable) FileFileGraph DataGraph Dataline plots, scatter plots line plots, scatter plots

(outcome variable on a predictor variable)(outcome variable on a predictor variable)

ijjij ry

Page 3: Examples from Singer’s Using SAS Proc Mixed to Fit Multilevel Models…

Example 2 in HLM: Include both level-1 Example 2 in HLM: Include both level-1 and level-2 predictorsand level-2 predictors

Level-1 variable SES is group-mean centeredLevel-1 variable SES is group-mean centered

Using level-2 variables to model random Using level-2 variables to model random intercept and random slopeintercept and random slope

Showing the mixed model versionShowing the mixed model version

jjj

jjj

ijijjjij

uSECTORMEANSES

uSECTORMEANSES

rSESSESy

11211101

00201000

10 )(

Page 4: Examples from Singer’s Using SAS Proc Mixed to Fit Multilevel Models…

Continued…Continued…

Estimation method: REML vs. MLEstimation method: REML vs. MLHypothesis testingHypothesis testing

Page 5: Examples from Singer’s Using SAS Proc Mixed to Fit Multilevel Models…

Example 3 in HLM: Unconditional Linear Growth ModelExample 3 in HLM: Unconditional Linear Growth Model

Use existing .mdm file to build up a modelUse existing .mdm file to build up a modelExploring the data graphicallyExploring the data graphicallyExploring the model graphicallyExploring the model graphically

-0.15 0.67 1.50 2.32 3.1585.70

142.35

199.00

255.65

312.30

TIME

Y

62.23

111.69

161.16

210.62

260.09

INT

ER

CE

PT

0 9.25 18.50 27.75 37.00

-28.69

-16.52

-4.34

7.83

20.01

Le

ve

l-1

Re

sid

ua

l

98.67 151.86 205.06 258.26

Level-1 Predicted Value

Page 6: Examples from Singer’s Using SAS Proc Mixed to Fit Multilevel Models…

Example 1 in MLwiN: Unconditional Means ModelExample 1 in MLwiN: Unconditional Means ModelFocus on showing how to input dataFocus on showing how to input data

ASCII format file (tab delimited file)ASCII format file (tab delimited file)

Page 7: Examples from Singer’s Using SAS Proc Mixed to Fit Multilevel Models…

Continued…Continued…

Stata2mlwin by Michael Mitchell (ATS), creating an ASCII data file Stata2mlwin by Michael Mitchell (ATS), creating an ASCII data file and an MLwiN command file (.obe file) to read the ASCII file with and an MLwiN command file (.obe file) to read the ASCII file with variable names into MLwiNvariable names into MLwiN

stata2mlwin using hsb12, replacestata2mlwin using hsb12, replace

Page 8: Examples from Singer’s Using SAS Proc Mixed to Fit Multilevel Models…

Continued…Continued…

REML vs. MLREML vs. MLDecomposition of variance into between and within varianceDecomposition of variance into between and within varianceIntraclass correlationIntraclass correlation

ijjij ry

Page 9: Examples from Singer’s Using SAS Proc Mixed to Fit Multilevel Models…

Example 2 in MLwiN: Include both level-1 and level-2 predictorsExample 2 in MLwiN: Include both level-1 and level-2 predictors

Page 10: Examples from Singer’s Using SAS Proc Mixed to Fit Multilevel Models…

Example 3 in MLwiN: Unconditional Linear Growth ModelExample 3 in MLwiN: Unconditional Linear Growth Model

Page 11: Examples from Singer’s Using SAS Proc Mixed to Fit Multilevel Models…

Model-based GraphicsModel-based Graphics

Page 12: Examples from Singer’s Using SAS Proc Mixed to Fit Multilevel Models…

Model-based GraphicsModel-based Graphics