Introduction and Background to Multilevel Analysis

Similar documents
Value Added Modeling

Introduction and Single Predictor Regression. Correlation

Hierarchical Linear Models (HLM) Using R Package nlme. Interpretation. 2 = ( x 2) u 0j. e ij

Workshop 9.3a: Randomized block designs

Independent Samples t tests. Background for Independent Samples t test

One-Way Analysis of Variance: ANOVA

STAT3401: Advanced data analysis Week 10: Models for Clustered Longitudinal Data

Subject-specific observed profiles of log(fev1) vs age First 50 subjects in Six Cities Study

lme4 Luke Chang Last Revised July 16, Fitting Linear Mixed Models with a Varying Intercept

ST430 Exam 2 Solutions

STAT 572 Assignment 5 - Answers Due: March 2, 2007

Power Analysis. Introduction to Power

Example: 1982 State SAT Scores (First year state by state data available)

R Output for Linear Models using functions lm(), gls() & glm()

Non-Gaussian Response Variables

36-309/749 Experimental Design for Behavioral and Social Sciences. Dec 1, 2015 Lecture 11: Mixed Models (HLMs)

Introduction to the Analysis of Hierarchical and Longitudinal Data

Outline. Mixed models in R using the lme4 package Part 3: Longitudinal data. Sleep deprivation data. Simple longitudinal data

Ron Heck, Fall Week 3: Notes Building a Two-Level Model

A brief introduction to mixed models

These slides illustrate a few example R commands that can be useful for the analysis of repeated measures data.

Coping with Additional Sources of Variation: ANCOVA and Random Effects

Random Intercept Models

MS&E 226: Small Data

Random and Mixed Effects Models - Part II

Simple Linear Regression

Mixed models in R using the lme4 package Part 2: Longitudinal data, modeling interactions

Introduction to Mixed Models in R

13. October p. 1

Table of Contents. Using R for Educational Research: An Introductory Workshop to Break the Learning Curve. Simple calculator usage.

Introduction to Within-Person Analysis and RM ANOVA

Using R for Educational Research: An Introductory Workshop to Break the Learning Curve

Stat 579: Generalized Linear Models and Extensions

Stat 5303 (Oehlert): Balanced Incomplete Block Designs 1

A (Brief) Introduction to Crossed Random Effects Models for Repeated Measures Data

36-463/663: Hierarchical Linear Models

Mixed effects models

Regression and the 2-Sample t

Class Notes: Week 8. Probit versus Logit Link Functions and Count Data

Stat 5102 Final Exam May 14, 2015

Outline. Statistical inference for linear mixed models. One-way ANOVA in matrix-vector form

Comparing Nested Models

Lecture 18: Simple Linear Regression

Topic 17 - Single Factor Analysis of Variance. Outline. One-way ANOVA. The Data / Notation. One way ANOVA Cell means model Factor effects model

Estimation and Centering

1 Multiple Regression

CAS MA575 Linear Models

STATISTICS 174: APPLIED STATISTICS FINAL EXAM DECEMBER 10, 2002

PAPER 30 APPLIED STATISTICS

Workshop 7.4a: Single factor ANOVA

Stat 5303 (Oehlert): Randomized Complete Blocks 1

The linear mixed model: introduction and the basic model

Mutilevel Models: Pooled and Clustered Data

SAS Syntax and Output for Data Manipulation: CLDP 944 Example 3a page 1

Categorical Predictor Variables

Multivariate Statistics in Ecology and Quantitative Genetics Summary

Recall that a measure of fit is the sum of squared residuals: where. The F-test statistic may be written as:

Tests of Linear Restrictions

Introduction to SAS proc mixed

Review of CLDP 944: Multilevel Models for Longitudinal Data

Technical Appendix C: Methods

ST430 Exam 1 with Answers

Formula for the t-test

Topic 23: Diagnostics and Remedies

Introduction to SAS proc mixed

36-707: Regression Analysis Homework Solutions. Homework 3

Lecture 6 Multiple Linear Regression, cont.

Inference for Regression

R in Linguistic Analysis. Wassink 2012 University of Washington Week 6

unadjusted model for baseline cholesterol 22:31 Monday, April 19,

One-Way ANOVA. Some examples of when ANOVA would be appropriate include:

Exploring Hierarchical Linear Mixed Models

Lecture 9 STK3100/4100

Additional Notes: Investigating a Random Slope. When we have fixed level-1 predictors at level 2 we show them like this:

Mixed models in R using the lme4 package Part 1: Linear mixed models with simple, scalar random

WU Weiterbildung. Linear Mixed Models

Multiple Linear Regression

Random and Mixed Effects Models - Part III

Mixed models in R using the lme4 package Part 1: Linear mixed models with simple, scalar random effects

Correlated Data: Linear Mixed Models with Random Intercepts

20. REML Estimation of Variance Components. Copyright c 2018 (Iowa State University) 20. Statistics / 36

General Linear Statistical Models - Part III

Dealing with Heteroskedasticity

Multiple Regression: Example

Statistics 135 Fall 2008 Final Exam

Multilevel Modeling: A Second Course

Model Estimation Example

Lecture 1: Linear Models and Applications

over Time line for the means). Specifically, & covariances) just a fixed variance instead. PROC MIXED: to 1000 is default) list models with TYPE=VC */

Nature vs. nurture? Lecture 18 - Regression: Inference, Outliers, and Intervals. Regression Output. Conditions for inference.

Overview. Multilevel Models in R: Present & Future. What are multilevel models? What are multilevel models? (cont d)

SAS Syntax and Output for Data Manipulation:

MISCELLANEOUS TOPICS RELATED TO LIKELIHOOD. Copyright c 2012 (Iowa State University) Statistics / 30

Ch 2: Simple Linear Regression

MIXED MODELS FOR REPEATED (LONGITUDINAL) DATA PART 2 DAVID C. HOWELL 4/1/2010

Can you tell the relationship between students SAT scores and their college grades?

Mixed models in R using the lme4 package Part 3: Linear mixed models with simple, scalar random effects

Intruction to General and Generalized Linear Models

SCHOOL OF MATHEMATICS AND STATISTICS

" M A #M B. Standard deviation of the population (Greek lowercase letter sigma) σ 2

Transcription:

Introduction and Background to Multilevel Analysis Dr. J. Kyle Roberts Southern Methodist University Simmons School of Education and Human Development Department of Teaching and Learning

Background and History of Multilevel Analysis Robinson (1950) and the problem of contextual effects The Frog-Pond Theory Pond A Pond B

History, cont. Statistical models that are not hierarchical sometimes ignore nesting structure and therefore report underestimated standard errors. Multilevel techniques are more efficient than other typical OLS techniques Multilevel techniques assume a General Linear Model framework and can thus perform all types of analyses. Multilevel techniques can go beyond questions of Do schools differ? to ask questions of Why do schools differ?

Types of Multilevel Structures Students nested in classrooms Students nested in schools Students nested in classrooms nested in schools Measurement occasions nested inside individuals Students cross-classified by middle and high school

Do We Really Need Multilevel Analysis? All data are multilevel! The problem of independence of observations GPA and the SAT in different high schools SES as it relates to school achievement The inefficiency of OLS techniques

Differences Between Multilevel and OLS Methods MLA is based on maximum likelihood and empirical Bayesian techniques 1 + 1 = 1.5

Notating the Multilevel ANOVA Recall from Analysis of Variance (ANOVA) that we may notate a model testing for differences between groups as: Y ij = µ+α j +ɛ ij, ɛ ij N (0, σ 2 ), j = 1,..., k, i = 1,..., n j We can further notate the above model as: Y ij = γ 00 + u 0j + e ij which may be decomposed as a Level-1 model Y ij = β 0j + e ij and Level-2 model β 0j = γ 00 + u 0j

Notating the Multilevel ANOVA (cont.) This means that any individual score within each group may be thought of as Y 11 =β 1 + e 11 Y 21 =β 1 + e 21 Y ij = β j + e ij Y 31 =β 1 + e 31... Y ij =β j + e ij And any group score may be modeled as: β 1 =γ 00 + u 01 β 2 =γ 00 + u 02 β j = γ 00 + u 0j β 3 =γ 00 + u 03... β j =γ 00 + u 0j

Graphical Example of Multilevel ANOVA

Understanding Errors

Heuristic Example of Multilevel ANOVA Suppose that we have a dataset in which we have scores from 160 students nested inside 16 different schools. The dataset may be found at http: //faculty.smu.edu/kyler/courses/7309/sciach.txt > sciach <- read.table("sciach.txt", header = T) > str(sciach) data.frame : 160 obs. of 10 variables: $ ID : int 1 2 3 4 5 6 7 8 9 10... $ GROUP : int 1 1 1 1 1 1 1 1 1 1... $ SCIENCE : int 1 1 2 2 3 3 4 4 5 5... $ URBAN : int 8 7 7 6 6 5 5 5 3 2... $ GENDER : int 1 1 1 1 1 2 2 2 2 2... $ CONS : int 1 1 1 1 1 1 1 1 1 1... $ URB.MEAN : num -6.43-7.43-7.43-8.43-8.43... $ SCH.RES : num 5 5 5 5 5 5 5 5 5 5... $ SCH.RES.MEAN: num -4.97-4.97-4.97-4.97-4.97... $ GEND.FAC : Factor w/ 2 levels "Female","Male": 2 2 2 2 2 1 1 1 1 1 > sciach$group <- factor(sciach$group)

ANOVA of Science Achievement Data We can run a simple ANOVA on the science achievement data comparing the means of the 16 schools. > mean(sciach$science) [1] 10.6875 > with(sciach, tapply(science, GROUP, mean)) 1 2 3 4 5 6 7 8 9 10 11 12 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 13 14 15 16 15.0 16.0 18.5 19.5 > anova(aov(science ~ GROUP, sciach)) Analysis of Variance Table Response: SCIENCE Df Sum Sq Mean Sq F value Pr(>F) GROUP 15 3859.4 257.292 130 < 2.2e-16 Residuals 144 285.0 1.979

Running the Same Model as a Multilevel ANOVA Recall from the multilevel ANOVA notation that we want to test: Y ij = γ 00 + u 0j + e ij > m0 <- lme(science ~ 1, random = ~1 GROUP, sciach) > summary(m0) Linear mixed-effects model fit by REML Data: sciach AIC BIC loglik 643.8561 653.0628-318.9281 Random effects: Formula: ~1 GROUP (Intercept) Residual StdDev: 5.052846 1.406829 Fixed effects: SCIENCE ~ 1 Value Std.Error DF t-value p-value (Intercept) 10.6875 1.268098 144 8.427975 0

Comparing OLS and MLA Estimates > cbind(means = with(sciach, tapply(science, GROUP, + mean)), coef(m0)) means (Intercept) 1 3.0 3.059135 2 4.0 4.051442 3 5.0 5.043750 4 6.0 6.036058 5 7.0 7.028365 6 8.0 8.020673 7 9.0 9.012981 8 10.0 10.005288 9 11.0 10.997596 10 12.0 11.989904 11 13.0 12.982212 12 14.0 13.974519 13 15.0 14.966827 14 16.0 15.959135 15 18.5 18.439904 16 19.5 19.432212

Checking Assumptions > par(mfrow = c(1, 2)) > boxplot(resid(m0) ~ GROUP, sciach, horizontal = T, + main = "Homogeneity of Variance") > qqnorm(resid(m0), main = "QQplot for Null Model") 1 3 5 7 9 12 15 2 1 0 1 2 Homogeneity of Variance 2 0 1 2 2 1 0 1 2 QQplot for Null Model Sample Quantiles

Model Fit Indices Chi-square or χ 2 χ 2 = 2 l Akaike Information Criteria (AIC) AIC = 2 l + 2K Bayesian Information Criteria (BIC) BIC = 2 l + K Ln(N)

Fixed and Random Effects Acting Out Acting Out Prescription Level (a) No Random Effects Prescription Level (b) Random Intercepts

Fixed and Random Effects Acting Out Acting Out Prescription Level (c) Random Slopes Prescription Level (d) Random Intercepts and Slopes

Recalling the OLS Linear Model Consider the following 1-level regression equation: y = a + bx + ɛ where: y - the response variable a - the y-intercept or the expected value when the covariate is 0 b - the expected change in the response variable (y) for every one unit change in the covariate x - the covariate ɛ - the residual term This model may also be written as: y = β 0 + β 1 x + ɛ

Adding a Random Effect for the Intercept We may further modify this equation to allow for variation among the intercepts for each pre-identified group such that: now becomes: y = β 0 + β 1 x + ɛ y ij = γ 00 + γ 10 x ij + u 0j + ɛ ij where: y ij - is the response variable for individual i in group j γ 00 - the y-intercept or the expected value when the covariate is 0 γ 10 - the expected change in the response variable (y) for every one unit change in the covariate x ij - the covariate term for each individual; the subscripts i and j mean that this variable is measured at the first level u 0j - the residual term defining the random variation of each of the group intercepts around the grand intercept γ 00 ɛ ij - the residual term defining the random variation of each person around their predicted group regression equation

Breaking Down the Mixed Effects Model into Levels From the previous slide, our mixed effects model: y ij = γ 00 + γ 10 x ij + u 0j + ɛ ij may be thought of as a 2-level model where: Level 1: y ij = β 0j + β 1j x ij + ɛ ij Level 2: β 0j = γ 00 + u 0j β 1j = γ 10 where: u 0j N (0, σu 2 0j ) ɛ ij N (0, σɛ 2 ij )

Understanding Errors Again

Running the Linear Model in R > m.lm <- lm(science ~ URBAN, sciach) > summary(m.lm) Call: lm(formula = SCIENCE ~ URBAN, data = sciach) Residuals: Min 1Q Median 3Q Max -5.3358-2.1292 0.4919 2.0432 5.0090 Coefficients: Estimate Std. Error t value Pr(> t ) (Intercept) -1.25108 0.59371-2.107 0.0367 URBAN 0.82763 0.03863 21.425 <2e-16 Residual standard error: 2.592 on 158 degrees of freedom Multiple R-squared: 0.7439, Adjusted R-squared: 0.7423 F-statistic: 459 on 1 and 158 DF, p-value: < 2.2e-16

Running the Linear Model in R (cont.) > plot(science ~ URBAN, sciach) > abline(lm(science ~ URBAN, sciach)) 5 10 15 20 25 5 10 15 20 URBAN SCIENCE

Running the Multilevel Model in R > m1 <- lme(science ~ URBAN, random = ~1 GROUP, + sciach) > summary(m1) Linear mixed-effects model fit by REML Data: sciach AIC BIC loglik 508.094 520.3444-250.047 Random effects: Formula: ~1 GROUP (Intercept) Residual StdDev: 9.29817 0.809449 Fixed effects: SCIENCE ~ URBAN Value Std.Error DF t-value p-value (Intercept) 22.302911 2.4263101 143 9.192111 0 URBAN -0.805228 0.0479985 143-16.776087 0 Correlation: (Intr) URBAN -0.285

Comparing Models > anova(m0, m1) Model df AIC BIC loglik Test L.Ratio m0 1 3 643.8561 653.0628-318.9281 m1 2 4 508.0940 520.3444-250.0470 1 vs 2 137.7621 p-value m0 m1 <.0001 So we can see that by the addition of a single fixed effect to our model, we reduced the AIC by 135 and the BIC by 133.