Weekend Workshop I PROC MIXED. Random or Fixed ?RANDOMFIXEDLevels: Selected at random from infinite population Finite number of possibilities Another.

Slides:



Advertisements
Similar presentations
Topic 12: Multiple Linear Regression
Advertisements

A. The Basic Principle We consider the multivariate extension of multiple linear regression – modeling the relationship between m responses Y 1,…,Y m and.
Research Support Center Chongming Yang
GENERAL LINEAR MODELS: Estimation algorithms
Data: Crab mating patterns Data: Typists (Poisson with random effects) (Poisson Regression, ZIP model, Negative Binomial) Data: Challenger (Binomial with.
Topic 32: Two-Way Mixed Effects Model. Outline Two-way mixed models Three-way mixed models.
Design and Analysis of Augmented Designs in Screening Trials
Statistical Analysis Professor Lynne Stokes Department of Statistical Science Lecture 15 Analysis of Data from Fractional Factorials and Other Unbalanced.
Statistical Analysis Professor Lynne Stokes Department of Statistical Science Lecture #19 Analysis of Designs with Random Factor Levels.
Comparison of Repeated Measures and Covariance Analysis for Pretest-Posttest Data -By Chunmei Zhou.
Some Terms Y =  o +  1 X Regression of Y on X Regress Y on X X called independent variable or predictor variable or covariate or factor Which factors.
Psychology 202b Advanced Psychological Statistics, II February 1, 2011.
Type I and Type III Sums of Squares. Confounding in Unbalanced Designs When designs are “unbalanced”, typically with missing values, our estimates of.
HIERARCHICAL LINEAR MODELS USED WITH NESTED DESIGNS IN EDUCATION, PSYCHOLOGY USES RANDOM FACTORS EXPECTED MEAN SQUARE THEORY COMBINES INFORMATION ACROSS.

LECTURE 13 ANALYSIS OF COVARIANCE AND COVARIANCE INTERACTION and ATI (Aptitude-Treatment Interaction)
Analysis of Covariance Goals: 1)Reduce error variance. 2)Remove sources of bias from experiment. 3)Obtain adjusted estimates of population means.
Every achievement originates from the seed of determination. 1Random Effect.
Purpose to compare average response among levels of the factors Chapters 2-4 -predict future response at specific factor level -recommend best factor.
Analysis of Covariance Goals: 1)Reduce error variance. 2)Remove sources of bias from experiment. 3)Obtain adjusted estimates of population means.
Longitudinal Data Analysis: Why and How to Do it With Multi-Level Modeling (MLM)? Oi-man Kwok Texas A & M University.
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.
Biostatistics-Lecture 9 Experimental designs Ruibin Xi Peking University School of Mathematical Sciences.
GEE and Generalized Linear Mixed Models
Introduction to Multilevel Modeling Using SPSS
1 Experimental Statistics - week 7 Chapter 15: Factorial Models (15.5) Chapter 17: Random Effects Models.
Fixed vs. Random Effects Fixed effect –we are interested in the effects of the treatments (or blocks) per se –if the experiment were repeated, the levels.
More complicated ANOVA models: two-way and repeated measures Chapter 12 Zar Chapter 11 Sokal & Rohlf First, remember your ANOVA basics……….
G Lecture 5 Example fixed Repeated measures as clustered data
Application of repeated measurement ANOVA models using SAS and SPSS: examination of the effect of intravenous lactate infusion in Alzheimer's disease Krisztina.
1 Experimental Statistics - week 10 Chapter 11: Linear Regression and Correlation.
1 Design of Engineering Experiments Part 10 – Nested and Split-Plot Designs Text reference, Chapter 14, Pg. 525 These are multifactor experiments that.
23-1 Analysis of Covariance (Chapter 16) A procedure for comparing treatment means that incorporates information on a quantitative explanatory variable,
Introduction Multilevel Analysis
1 Experimental Statistics - week 10 Chapter 11: Linear Regression and Correlation Note: Homework Due Thursday.
Completing the ANOVA From the Summary Statistics.
Introduction* to Mixed Effects and Repeated Measures Models
Randomized Block Design (Kirk, chapter 7) BUSI 6480 Lecture 6.
Modeling Repeated Measures or Longitudinal Data. Example: Annual Assessment of Renal Function in Hypertensive Patients UNITNOYEARAGESCrEGFRPSV
Multilevel Linear Modeling aka HLM. The Design We have data at two different levels In this case, 7,185 students (Level 1) Nested within 160 Schools (Level.
The Completely Randomized Design (§8.3)
BUSI 6480 Lecture 8 Repeated Measures.
Control of Experimental Error Blocking - –A block is a group of homogeneous experimental units –Maximize the variation among blocks in order to minimize.
Topic 30: Random Effects. Outline One-way random effects model –Data –Model –Inference.
Topic 26: Analysis of Covariance. Outline One-way analysis of covariance –Data –Model –Inference –Diagnostics and rememdies Multifactor analysis of covariance.
PSYC 3030 Review Session April 19, Housekeeping Exam: –April 26, 2004 (Monday) –RN 203 –Use pencil, bring calculator & eraser –Make use of your.
By: Corey T. Williams 03 May Situation Objective.
Simple Linear Regression. Data available : (X,Y) Goal : To predict the response Y. (i.e. to obtain the fitted response function f(X)) Least Squares Fitting.
Environmental Modeling Basic Testing Methods - Statistics III.
General Linear Model.
1 Experimental Statistics - week 9 Chapter 17: Models with Random Effects Chapter 18: Repeated Measures.
FIXED AND RANDOM EFFECTS IN HLM. Fixed effects produce constant impact on DV. Random effects produce variable impact on DV. F IXED VS RANDOM EFFECTS.
SAS® Global Forum 2014 March Washington, DC Got Randomness?
1 Statistics 262: Intermediate Biostatistics Regression Models for longitudinal data: Mixed Models.
Experimental Statistics - week 9
Biostatistics Case Studies Peter D. Christenson Biostatistician Session 3: Missing Data in Longitudinal Studies.
G Lecture 71 Revisiting Hierarchical Mixed Models A General Version of the Model Variance/Covariances of Two Kinds of Random Effects Parameter Estimation.
1 Experimental Statistics - week 8 Chapter 17: Mixed Models Chapter 18: Repeated Measures.
1 Experimental Statistics - week 12 Chapter 11: Linear Regression and Correlation Chapter 12: Multiple Regression.
Jump to first page Bayesian Approach FOR MIXED MODEL Bioep740 Final Paper Presentation By Qiang Ling.
1 Experimental Statistics - week 11 Chapter 11: Linear Regression and Correlation.
Linear Mixed Models in JMP Pro
Topic 31: Two-way Random Effects Models
BIBD and Adjusted Sums of Squares
Introduction to Longitudinal Data Analysis Lisa Wang Jan. 29, 2015
G Lecture 6 Multilevel Notation; Level 1 and Level 2 Equations
OVERVIEW OF LINEAR MODELS
A Gentle Introduction to Linear Mixed Modeling and PROC MIXED
OVERVIEW OF LINEAR MODELS
Presentation transcript:

Weekend Workshop I PROC MIXED

Random or Fixed ?RANDOMFIXEDLevels: Selected at random from infinite population Finite number of possibilities Another Experiment Different selections from same population Same Levels Goal Estimate variance components Compare means Inference All levels in population Only levels used in the experiment.

Twins: One gets SAS training method 1, the other gets method 2 Response Y = programming times

PROC MIXED Model PROC MIXED Model Y = X  Z  + e Variance of  is G =,Variance of e is R = Model ; Random ; Repeated ;

PROC MIXED DATA=TWINS; CLASS FAMILY METHOD; MODEL TIME = METHOD; * fixed; RANDOM FAMILY; *<- family ~ N(0,  2 F ) ; Covariance Parameter Estimates Cov Parm Estimate family Residual Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value Pr > F method Intraclass correlation (related to heritability)  2 F /(  2 F +  2 ) Estimated as 21.2/62 or about 1/3. Q: Why not usual (Pearson) correlation?

DemoGet_Twins.sas Twins_MIXED.sas Twins_MIXED.sas

BLUP Y ij =  + F i + e ij D i = Family mean –  F i + e i. best estimate of F i = ? Variance of (F i – b D i ) is (1-b) 2  2 F + b 2  2 /2 Use b =  2 F /(  2 F +  2 /2) Estimate: b = 21.2/( /2) = Overall mean (Family i mean – Overall mean) PROC MIXED DATA=TWINS; CLASS FAMILY METHOD; MODEL TIME = METHOD; RANDOM FAMILY; ESTIMATE "1 " intercept 1 | family 1; ESTIMATE "2 " intercept 1 | family 0 1; PROC GLM DATA=TWINS; CLASS FAMILY METHOD; MODEL TIME = FAMILY METHOD; LSMEANS FAMILY;

MEANS andBLUPs MEANS and BLUPs (MIXED)(GLM)

Demo Twins_BLUP.sas Twins_BLUP.sasTwins_TEST.sas

REML Estimation (1)Regress out fixed effects (2)Maximze likelihood of residuals (mean known: 0) (3)Variance estimates less biased (unbiased in some simple cases) (3)Variance estimates less biased (unbiased in some simple cases) ML Estimation Search over all (fixed and random) parameters Search over all (fixed and random) parameters Estimates of variances biased low! 

Unbalanced Data Unbalanced Data SUBJ  Ear plug ABCDEFG I 25 (L)19 (L)29 (R)16 (R)25 (L) II 8 (R)7 (L)23 (L)16 (R)24 (R) III 22 (R)7 (R)14 (L)12 (L) I vs. III free of subject effects for red data. Misses info in other data.

proc glm; class plug worker; model loss = worker plug; Random Worker; Estimate "I vs III - GLM" Plug ; run; proc mixed; class plug worker; model Loss=Plug; Random Worker; Estimate "I vs III - Mixed" Plug ; run; GLM Source DF Type III SS F Value Pr > F worker plug Standard Parameter Estimate Error t Value Pr > |t| I vs III - GLM Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value Pr > F plug Estimates Standard Label Estimate Error DF t Value Pr > |t| I vs III - Mixed Covariance Parameter Estimates Cov Parm Estimate worker Residual

Demo Earplugs.sas Earplugs.sas

Soil Variety Aquariums, 2 aerated 2 not six dishes / aquarium one plant / dish soil x variety combinations ANOVA SourceAir Error A V S VA VS AS AVS Error B SPLIT PLOT

PROC MIXED; CLASS VAR AQUARIUM SOIL AIR; MODEL YIELD = AIR SOIL VAR SOIL*VAR AIR*SOIL AIR*VAR AIR*SOIL*VAR / DDFM=SATTERTHWAITE; RANDOM AQUARIUM(AIR); ESTIMATE "SOIL 1: AIR EFFECT" AIR -1 1 AIR*SOIL ; RUN; Compare Air to No Air within soil 1 Variance of this contrast is hard to figure out: (1/3)[MS(A)+2 MS(B)] Need Satterthwaite df AUTOMATIC IN MIXED!!!

Covariance Parameter Estimates Cov Parm Estimate AQUARIUM(AIR) Residual Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value Pr > F AIR SOIL VAR VAR*SOIL SOIL*AIR VAR*AIR VAR*SOIL*AIR Standard Label Estimate Error DF t Value Pr > |t| SOIL 1: AIR EFFECT

Demo Aquarium.sas Aquarium.sas

Random Coefficient Models Random Coefficient Models the basic idea the basic idea mistakes Program writing time Average programmer Dave Line for individual j: (a 0 + a j ) + ( b 0 + b j )t a 0 + b 0 t

Hierarchial Models (1)Same as split plot - almost (2)Whole and split level continuous predictor variables (typically) (1)Aquarium level (level i): pH i (2)Dish level: Soil nitrogen test (N ij ) Y ij = a i + b i N ij +e ij (3) Idea: a i =  0 +  1 pH i + a i * b i =  0 +  1 pH i + b i * b i =  0 +  1 pH i + b i * Y ij = a i + b i N ij +e ij Y ij =  0 +  1 pH i + a i * + b i N ij +e ij Y ij =  0 +  1 pH i + a i * + (  0 +  1 pH i + b i * ) N ij +e ij Y ij = [  0 +  1 pH i +  0 N ij +  1 pH i N ij ] + [a i * +b i * N ij +e ij ] fixed random fixed random PROC MIXED DATA = UNDERWATER; MODEL GROWTH = N P N*P; RANDOM INTERCEPT N / SUBJECT = TANK TYPE=UN;

p Num Den Effect DF DF F Value Pr > F N pH N*pH aquarium N pH growth Num Den Effect DF DF F Value Pr > F N pH Cov Parm Estimate UN(1,1) UN(2,1) UN(2,2) Residual pH N

Demo Hierarchial.sas Hierarchial.sas

Next: Repeated Measures Notes in pdf from NCSU experimental design class (ST 711)

Demo SURGERY.sas SURGERY.sas