Topic 32: Two-Way Mixed Effects Model

Similar documents
Statistics 512: Applied Linear Models. Topic 9

SAS Commands. General Plan. Output. Construct scatterplot / interaction plot. Run full model

Unbalanced Designs Mechanics. Estimate of σ 2 becomes weighted average of treatment combination sample variances.

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

Outline Topic 21 - Two Factor ANOVA

Topic 29: Three-Way ANOVA

Topic 20: Single Factor Analysis of Variance

Topic 28: Unequal Replication in Two-Way ANOVA

Topic 25 - One-Way Random Effects Models. Outline. Random Effects vs Fixed Effects. Data for One-way Random Effects Model. One-way Random effects

Two-factor studies. STAT 525 Chapter 19 and 20. Professor Olga Vitek

Topic 23: Diagnostics and Remedies

Outline. Topic 22 - Interaction in Two Factor ANOVA. Interaction Not Significant. General Plan

Outline. Topic 19 - Inference. The Cell Means Model. Estimates. Inference for Means Differences in cell means Contrasts. STAT Fall 2013

TWO OR MORE RANDOM EFFECTS. The two-way complete model for two random effects:

Lecture 10: Factorial Designs with Random Factors

Outline. Topic 20 - Diagnostics and Remedies. Residuals. Overview. Diagnostics Plots Residual checks Formal Tests. STAT Fall 2013

MAT3378 ANOVA Summary

Statistics 512: Applied Linear Models. Topic 7

Two or more categorical predictors. 2.1 Two fixed effects

Analysis of Covariance

This is a Randomized Block Design (RBD) with a single factor treatment arrangement (2 levels) which are fixed.

Homework 3 - Solution

Factorial ANOVA. Psychology 3256

Chapter 2 Inferences in Simple Linear Regression

Random and Mixed Effects Models - Part II

STAT 5200 Handout #23. Repeated Measures Example (Ch. 16)

Chapter 1 Linear Regression with One Predictor

Chapter 8 Quantitative and Qualitative Predictors

Topic 16: Multicollinearity and Polynomial Regression

Lecture 10: Experiments with Random Effects

Lecture 3. Experiments with a Single Factor: ANOVA Montgomery 3-1 through 3-3

Lecture 9: Factorial Design Montgomery: chapter 5

Odor attraction CRD Page 1

Lecture 4. Random Effects in Completely Randomized Design

T-test: means of Spock's judge versus all other judges 1 12:10 Wednesday, January 5, judge1 N Mean Std Dev Std Err Minimum Maximum

One-Way Analysis of Variance (ANOVA) There are two key differences regarding the explanatory variable X.

Topic 14: Inference in Multiple Regression

Outline. Review regression diagnostics Remedial measures Weighted regression Ridge regression Robust regression Bootstrapping

Topic 18: Model Selection and Diagnostics

dm'log;clear;output;clear'; options ps=512 ls=99 nocenter nodate nonumber nolabel FORMCHAR=" = -/\<>*"; ODS LISTING;

Lecture 3. Experiments with a Single Factor: ANOVA Montgomery 3.1 through 3.3

Analysis of Variance and Design of Experiments-I

WITHIN-PARTICIPANT EXPERIMENTAL DESIGNS

EXST 7015 Fall 2014 Lab 11: Randomized Block Design and Nested Design

Stat 579: Generalized Linear Models and Extensions

Single Factor Experiments

SAS Syntax and Output for Data Manipulation:

13. The Cochran-Satterthwaite Approximation for Linear Combinations of Mean Squares

Mixed Model: Split plot with two whole-plot factors, one split-plot factor, and CRD at the whole-plot level (e.g. fancier split-plot p.

Mixed Model: Split plot with two whole-plot factors, one split-plot factor, and CRD at the whole-plot level (e.g. fancier split-plot p.

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

Unit 7: Random Effects, Subsampling, Nested and Crossed Factor Designs

Answer to exercise: Blood pressure lowering drugs

Differences of Least Squares Means

Comparison of a Population Means

1 Tomato yield example.

Statistics 210 Part 3 Statistical Methods Hal S. Stern Department of Statistics University of California, Irvine

Chapter 11. Analysis of Variance (One-Way)

BIOSTATISTICAL METHODS

Factorial designs. Experiments

ANOVA Longitudinal Models for the Practice Effects Data: via GLM

Split-plot Designs. Bruce A Craig. Department of Statistics Purdue University. STAT 514 Topic 21 1

EXST Regression Techniques Page 1. We can also test the hypothesis H :" œ 0 versus H :"

STA 303H1F: Two-way Analysis of Variance Practice Problems

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

Theorem A: Expectations of Sums of Squares Under the two-way ANOVA model, E(X i X) 2 = (µ i µ) 2 + n 1 n σ2

Two-Way Factorial Designs

STAT 705 Chapter 19: Two-way ANOVA

General Linear Model (Chapter 4)

SAS Program Part 1: proc import datafile="y:\iowa_classes\stat_5201_design\examples\2-23_drillspeed_feed\mont_5-7.csv" out=ds dbms=csv replace; run;

Example: Four levels of herbicide strength in an experiment on dry weight of treated plants.

Unit 8: A Mixed Two-Factor Design

Lecture 27 Two-Way ANOVA: Interaction

STAT 5200 Handout #26. Generalized Linear Mixed Models

Power Analysis for One-Way ANOVA

Lecture 2: Basic Concepts and Simple Comparative Experiments Montgomery: Chapter 2

STAT 705 Chapter 19: Two-way ANOVA

Incomplete Block Designs

Analysis of Variance

Analysis of Longitudinal Data: Comparison Between PROC GLM and PROC MIXED. Maribeth Johnson Medical College of Georgia Augusta, GA

Descriptions of post-hoc tests

Inference for Regression Inference about the Regression Model and Using the Regression Line

STAT22200 Spring 2014 Chapter 8A

Random and Mixed Effects Models - Part III

Statistics 512: Applied Linear Models. Topic 1

Linear Combinations. Comparison of treatment means. Bruce A Craig. Department of Statistics Purdue University. STAT 514 Topic 6 1

2-way analysis of variance

The Random Effects Model Introduction

Lecture 4. Checking Model Adequacy

Lecture 7: Latin Square and Related Design

Repeated Measures Design. Advertising Sales Example

Unit 8: A Mixed Two-Factor Design

iron retention (log) high Fe2+ medium Fe2+ high Fe3+ medium Fe3+ low Fe2+ low Fe3+ 2 Two-way ANOVA

STOR 455 STATISTICAL METHODS I

Ch 3: Multiple Linear Regression

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

Multi-factor analysis of variance

Lecture 12: 2 k Factorial Design Montgomery: Chapter 6

Course Information Text:

data proc sort proc corr run proc reg run proc glm run proc glm run proc glm run proc reg CONMAIN CONINT run proc reg DUMMAIN DUMINT run proc reg

Transcription:

Topic 3: Two-Way Mixed Effects Model

Outline Two-way mixed models Three-way mixed models

Data for two-way design Y is the response variable Factor A with levels i = 1 to a Factor B with levels j = 1 to b Y ijk is the k th observation in cell (i, j) k = 1 to n ij Have balanced designs with n = n ij

Two-way mixed model Two-way mixed model has One fixed effect One random effect Tests: Again use EMS as guide Two possible models Unrestricted mixed model (SAS) Restricted mixed model (Text)

KNNL Example KNNL Problem 5.15, p 1080 Y is fuel efficiency in miles per gallon Factor A represents four different drivers, a=4 levels Factor B represents five different cars of the same model, b=5 Each driver drove each car twice over the same 40-mile test course

Read and check the data data a1; infile 'c:\...\ch5pr15.txt'; input mpg driver car; proc print data=a1; run;

The data Obs mpg driver car 1 5.3 1 1 5. 1 1 3 8.9 1 4 30.0 1 5 4.8 1 3 6 5.1 1 3 7 8.4 1 4 8 7.9 1 4 9 7.1 1 5 10 6.6 1 5

Prepare the data for a scatterplot data a1; set a1; if (driver eq 1)*(car eq 1) then dc='01_1a'; if (driver eq 1)*(car eq ) then dc='0_1b'; if (driver eq 4)*(car eq 5) then dc='0_4e';

Plot the data title1 'Plot of the data'; symbol1 v=circle i=none c=black; proc gplot data=a1; plot mpg*dc/frame; run;

Find the means proc means data=a1; output out=a mean=avmpg; var mpg; by driver car;

Plot the means title1 'Plot of the means'; symbol1 v='a' i=join c=black; symbol v='b' i=join c=black; symbol3 v='c' i=join c=black; symbol4 v='d' i=join c=black; symbol5 v='e' i=join c=black; proc gplot data=a; plot avmpg*driver=car/frame; run;

Example Revision Suppose that the four drivers were not randomly selected and there is interest in comparing the four drivers in the study Driver (A) is now a fixed effect Still consider Car (B) to be a random effect

Mixed effects model (unrestricted) Y ijk = μ + α i + β j + (αβ) ij + ε ijk α i are unknown constants β j ~ N(0, σ β ) (αβ) ij ~ N(0, σ αβ ) ε ij ~ N(0, σ ) σ Y = σ β + σ αβ + σ Σα i =0 (common restriction)

Mixed effects model (restricted) Y ijk = μ + α i + β j N ε ij ~ N(0, σ ) + (αβ) ij + ε ijk a 1 β j ~ (0, σ β ) and ( αβ ) ij ~ N(0, σ αβ ) a σ Y = σ β + ((a-1)/a)σ αβ + σ Common restrictions on fixed effects Σα i =0 Σ(αb) ij =0 for all j

Parameters There are a+3 parameters in this model a fixed effects means σ β σ αβ σ

ANOVA table The terms and layout of the ANOVA table are the same as what we used for the fixed effects model The expected mean squares (EMS) are different and vary based on the choice of unrestricted or restricted mixed model

EMS (unrestricted) E(MSA) = σ + bnσα i /(a-1)+ nσ αβ E(MSB) = σ + anσ β + nσ αβ E(MSAB) = σ + nσ αβ E(MSE) = σ Estimates of the variance components can be obtained from these equations, replacing E(MS) with table value, or other methods such as ML

EMS (restricted) E(MSA) = σ + bnσα i /(a-1)+ nσ αβ E(MSB) = σ + anσ β E(MSAB) = σ + nσ αβ Different here E(MSE) = σ Estimates of the variance components can be obtained from these equations, replacing E(MS) with table value, or other methods such as ML

Hypotheses (unrestricted) H 0A : σ α = 0; H 1A : σ α 0 H 0A is tested by F = MSA/MSAB with df a-1 and (a-1)(b-1) H 0B : σ β = 0; H 1B : σ β 0 H 0B is tested by F = MSB/MSAB with df b-1 and (a-1)(b-1) H 0AB : σ αβ = 0; H 1AB : σ αβ 0 H 0AB is tested by F = MSAB/MSE with df (a-1)(b-1) and ab(n-1)

Hypotheses (restricted) H 0A : σ α = 0; H 1A : σ α 0 H 0A is tested by F = MSA/MSAB with df a-1 and (a-1)(b-1) H 0B : σ β = 0; H 1B : σ β 0 H 0B is tested by F = MSB/MSE with df b-1 and ab(n-1) H 0AB : σ αβ = 0; H 1AB : σ αβ 0 H 0AB is tested by F = MSAB/MSE with df (a-1)(b-1) and ab(n-1)

Comparison of Means To compare fixed levels of A, std error is MSAB / bn Degrees of freedom for t tests and CIs are then (a-1)(b-1) This is true for both unrestricted and restricted mixed models

Using Proc Mixed proc mixed data=a1; class car driver; model mpg=driver; random car car*driver / vcorr; lsmeans driver / adjust=tukey; run; SAS considers unrestricted model only results in slightly different variance estimates. Not crucial if goal is to compare fixed effect means

SAS Output Covariance Parameter Estimates Cov Parm Estimate car.9343 car*driver 0.01406 Residual 0.1757 Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value Pr > F driver 3 1 458.6 <.0001

SAS Output Least Squares Means Standard Effect driver Estimate Error DF t Value Pr > t driver 1 6.9300 0.7793 1 34.56 <.0001 driver 34.1500 0.7793 1 43.8 <.0001 driver 3 8.8500 0.7793 1 37.0 <.0001 driver 4 30.600 0.7793 1 38.83 <.0001 Proc GLM provides wrong SE here

SAS Output Differences of Least Squares Means Effect driver _driver Estiate Standard Error DF t Value Pr > t Adjustment driver 1-7.00 0.019 1-35.76 <.0001 Tukey- Kramer driver 1 3-1.900 0.019 1-9.51 <.0001 Tukey- Kramer driver 1 4-3.3300 0.019 1-16.49 <.0001 Tukey- Kramer driver 3 5.3000 0.019 1 6.5 <.0001 Tukey- Kramer driver 4 3.8900 0.019 1 19.6 <.0001 Tukey- Kramer driver 3 4-1.4100 0.019 1-6.98 <.0001 Tukey- Kramer Adj P <.0001 <.0001 <.0001 <.0001 <.0001 <.0001

Three-way models We can have zero, one, two, or three random effects EMS indicate how to do tests In some cases the situation is complicated and we need approximations of an F test Example: when all are random, use MS(AB)+MS(AC)-MS(ABC) to test A

Last slide Finish reading KNNL Chapter 5 We used program topic3.sas to generate the output for today