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.

Size: px
Start display at page:

Download "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."

Transcription

1 STAT:5201 Applied Statistic II 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.422 OLRT) Hamster example with three fixed factors of interest: DayLength (short/long), Climate (cold/warm), Tissue (heart/brain) (see HW 2 for the full set-up.) Two hamsters randomly assigned to each combination of DayLength/Climate. Then, two measurements are taken on each hamster in the brain and heart. The main goal of the analysis is perform comparison tests of the three factors of interest. SAS statements for data input: proc import datafile="split_plot_hamsters.csv" out=ham dbms=csv replace; /*Create Superfactor column for plotting:*/ data ham; set ham; if DayLength="short" & Climate="cold" then Superfactor="SC"; if DayLength="short" & Climate="warm" then Superfactor="SW"; if DayLength="long" & Climate="cold" then Superfactor="LC"; if DayLength="long" & Climate="warm" then Superfactor="LW"; ; proc print data=ham; Day Obs Hamster Length Climate Tissue NI Superfactor 1 1 short cold heart 2.32 SC 2 1 short cold brain SC 3 2 short cold heart 0.29 SC 4 2 short cold brain 9.93 SC 5 3 short warm heart 2.26 SW 6 3 short warm brain SW 7 4 short warm heart 1.79 SW 8 4 short warm brain SW 9 5 long cold heart 0.49 LC 10 5 long cold brain 5.18 LC 11 6 long cold heart 0.54 LC 12 6 long cold brain 9.28 LC 13 7 long warm heart 2.31 LW 14 7 long warm brain LW 15 8 long warm heart 0.79 LW 16 8 long warm brain 7.80 LW 1

2 symbol1 value=star i=std1mj color=black line=1 height=2; symbol2 value=circle i=std1mj color=blue line=2 height=2; proc gplot data=ham; plot NI*Superfactor=Tissue; SAS statements for Proc GLM and expected mean squares: proc glm data=ham; class DayLength Climate Tissue Hamster; model NI=DayLength Climate Tissue Hamster(DayLength*Climate); random Hamster(DayLength*Climate)/test; NOTE: I recommend using residual plots from PROC MIXED for diagnostics rather then PROC GLM. The GLM Procedure Class Level Information Class Levels Values DayLength 2 long short Climate 2 cold warm Tissue 2 brain heart Hamster Dependent Variable: NI Sum of Source DF Squares Mean Square F Value Pr > F Model Error Corrected Total

3 The GLM Procedure Source Type III Expected Mean Square DayLength Var(Error) + 2 Var(Hamst(DayLen*Climat)) + Q(DayLength,DayLength*Climate,DayLength*Tissue,DayLen* Climat*Tissue) Climate Var(Error) + 2 Var(Hamst(DayLen*Climat)) + Q(Climate,DayLength*Climate,Climate*Tissue,DayLen*Climat* Tissue) DayLength*Climate Var(Error) + 2 Var(Hamst(DayLen*Climat)) + Q(DayLength*Climate,DayLen*Climat*Tissue) Tissue Var(Error) + Q(Tissue,DayLength*Tissue,Climate*Tissue,DayLen*Climat* Tissue) DayLength*Tissue Climate*Tissue DayLen*Climat*Tissue Hamst(DayLen*Climat) Var(Error) + Q(DayLength*Tissue,DayLen*Climat*Tissue) Var(Error) + Q(Climate*Tissue,DayLen*Climat*Tissue) Var(Error) + Q(DayLen*Climat*Tissue) Var(Error) + 2 Var(Hamst(DayLen*Climat)) Above, you can see that SAS includes other fixed terms in the Q() value that contain the given term, but it is essentially only testing for the given fixed term on the left. To match our previous notation, we could write... The GLM Procedure Source DayLength Climate DayLength*Climate Tissue DayLength*Tissue Climate*Tissue DayLen*Climat*Tissue Hamst(DayLen*Climat) Type III Expected Mean Square Var(Error) + 2 Var(Hamst(DayLen*Climat)) + Q(DayLength) Var(Error) + 2 Var(Hamst(DayLen*Climat)) + Q(Climate) Var(Error) + 2 Var(Hamst(DayLen*Climat)) +Q(DayLength*Climate) Var(Error) + Q(Tissue) Var(Error) + Q(DayLength*Tissue) Var(Error) + Q(Climate*Tissue) Var(Error) + Q(DayLen*Climat*Tissue) Var(Error) + 2 Var(Hamst(DayLen*Climate)) 3

4 After choosing the test option, the correct errors are used for the F-tests: Dependent Variable: NI The GLM Procedure Tests of Hypotheses for Mixed Model Analysis of Variance Source DF Type III SS Mean Square F Value Pr > F DayLength Climate DayLength*Climate Error Error: MS(Hamst(DayLen*Climat)) Source DF Type III SS Mean Square F Value Pr > F Tissue DayLength*Tissue Climate*Tissue DayLen*Climat*Tissue Hamst(DayLen*Climat) Error: MS(Error) SAS statements for Proc Mixed: proc mixed data=ham plots(only)=residualpanel(conditional); class DayLength Climate Tissue Hamster; model NI=DayLength Climate Tissue/ddfm=satterth outp=preddata residual; /* preddata contains*/ random Hamster(DayLength*Climate); /* conditional resids and predicted values*/ The Mixed Procedure Covariance Parameter Estimates Cov Parm Estimate Hamst(DayLen*Climat) Residual

5 Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value Pr > F DayLength Climate DayLength*Climate Tissue <--- DayLength*Tissue <--- Climate*Tissue DayLen*Climat*Tissue The 3-way interaction was not significant. The only 2-way interaction that was significant was the DayLength*Tissue interaction, which seems apparent in the plot... The first two Superfactor levels are on the left and coincide with DayLength of long. The Tissue effect seems to be larger when DayLength is short and smaller when DayLength is long. Comparisons of means can be done as usual with a 3-way factorial. Diagnostics are still relevant, and we will consider the residuals now (from the split-plot experimental error)... 5

6 Constant variance plot has an issue with non-constant variance. It does look like a pattern of non-constance variance (monotonically increasing) that may be helped by a transformation (the square root transformation looks pretty good). Normality looks OK. SAS Documentation on available residuals: viewer.htm#statug_mixed_sect027.htm#statug.mixed.mixeddetailres 6

7 Fitting this model in R (extra information) ## Use the same dummy coding as SAS: > options(contrasts=c("contr.sas","contr.poly")) ## Load the linear mixed-effects package lme4. > library(lme4) # Get the data > hamsterdata <- read.csv("split_plot_hamsters.csv") > head(hamsterdata) Hamster DayLength Climate Tissue NI 1 1 short cold heart short cold brain short cold heart short cold brain short warm heart short warm brain ## Coerce the hamster variable to be a factor: > hamsterdata$hamster <- as.factor(hamsterdata$hamster) ## Fit the model... ## Include all main effects and interactions for fixed effects. ## Include a random hamster effect for each hamster nested in ## the treatment combination of Climate:DayLength. > model <- lmer(ni ~ 1 + DayLength + Climate + DayLength:Climate + Tissue + Tissue:DayLength + Tissue:Climate + Tissue:DayLength:Climate + (1 (Climate:DayLength):Hamster), data = hamsterdata) ## The first part of the model statement is for the fixed effects. ## The second part in parentheses is for the random effects. ## The (1 (Climate:DayLength):Hamster) tells lmer to fit a different ## random intercept for all Climate-by-DayLength-by-hamster combinations. SIDENOTE: The traditional split-plot example with secretaries (where the whole-plot looked like a CRD) can be fit in R using the code below. model <- lmer(numsorted ~ periods + (1 periods:secretary) + timeday + timeday:periods, data = secretaries) Diagnostics: > plot(model) > qqnorm(residuals(model)) > qqline(residuals(model)) 7

8 Normal Q-Q Plot resid(., type = "pearson") Sample Quantiles fitted(.) Theoretical Quantiles > summary(model) Linear mixed model fit by REML [ lmermod ] Formula: NI ~ 1 + DayLength + Climate + DayLength:Climate + Tissue + Tissue:DayLength + Tissue:Climate + Tissue:DayLength:Climate + (1 (DayLength:Climate):Hamster) Data: hamsterdata REML criterion at convergence: 40 Random effects: Groups Name Variance Std.Dev. (Climate:DayLength):Hamster (Intercept) Residual Number of obs: 16, groups: (Climate:DayLength):Hamster, 8 Compare these estimates to the SAS covariance parameter estimates below (they match): The Mixed Procedure Covariance Parameter Estimates Cov Parm Estimate Hamst(DayLen*Climat) Residual Fixed effects: Estimate Std. Error t value (Intercept) Tissuebrain Climatecold DayLengthlong Tissuebrain:Climatecold Tissuebrain:DayLengthlong Climatecold:DayLengthlong Tissuebrain:Climatecold:DayLengthlong

9 Compare the above estimates to the SAS fixed effects estimates below (they match): One of the issues with the lme4 package is that it does not directly provide p-values for the fixed effects (a common request from clients). Presently, I am using the package called lmertest to get p-values and lsmean values for mixed models in R. > library(lmertest) The lmertest package has a function called anova() which will mask the base package anova() function with one that gives you Type III tests (I find it annoying that they used the exact same function name... causes confusion, but it will get you what you want). You MUST RE-FIT THE MODEL after loading lmertest (it s actually the lmertest::lmer() function now) > model <- lmer(ni ~ 1 + DayLength + Climate + DayLength:Climate + Tissue + Tissue:DayLength + Tissue:Climate + Tissue:DayLength:Climate + (1 (Climate:DayLength):Hamster), data = hamsterdata) > lmertest::anova(model) Analysis of Variance Table of type III with Satterthwaite approximation for degrees of freedom Sum Sq Mean Sq NumDF DenDF F.value Pr(>F) DayLength Climate Tissue *** DayLength:Climate DayLength:Tissue * Climate:Tissue DayLength:Climate:Tissue

10 Compare the above F-statistics to the SAS output below (they match): Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value Pr > F DayLength Climate DayLength*Climate Tissue DayLength*Tissue Climate*Tissue DayLen*Climat*Tissue The lmertest package also has a function called lsmeanslt to provide SAS-type LSMEANS: > lsmeanslt(model,test.effs="daylength:tissue",ddf="satterthwaite") Least Squares Means table: DayLength Climate Tissue Estimate Standard Error DF t-value DayLength:Tissue long brain 1 NA DayLength:Tissue short brain 2 NA DayLength:Tissue long heart 1 NA DayLength:Tissue short heart 2 NA Lower CI Upper CI p-value DayLength:Tissue long brain e-04 *** DayLength:Tissue short brain <2e-16 *** DayLength:Tissue long heart DayLength:Tissue short heart Signif. codes: 0 *** ** 0.01 * And to give estimated differences of LSMEANS: > difflsmeans(model,test.effs="daylength:tissue",ddf="satterthwaite") Differences of LSMEANS: Estimate Standard Error DF t-value Lower CI DayLength:Tissue long brain - short brain DayLength:Tissue long brain - long heart DayLength:Tissue long brain - short heart DayLength:Tissue short brain - long heart DayLength:Tissue short brain - short heart DayLength:Tissue long heart - short heart Upper CI p-value DayLength:Tissue long brain - short brain ** DayLength:Tissue long brain - long heart ** DayLength:Tissue long brain - short heart ** DayLength:Tissue short brain - long heart e-04 *** DayLength:Tissue short brain - short heart e-04 *** DayLength:Tissue long heart - short heart Signif. codes: 0 *** ** 0.01 *

11 But it looks like you can not apply any multiple comparison adjustment using this difflsmeans. You can always apply the Bonferroni adjustment, but if you want a Tukey adjustment, you could use the lsmeans package by Russ Lenth. > library(lsmeans) > lsmeans(model, list(pairwise ~ DayLength:Tissue), adjust = "tukey") NOTE: Results may be misleading due to involvement in interactions $ lsmeans of DayLength, Tissue DayLength Tissue lsmean SE df lower.cl upper.cl long brain short brain long heart short heart Results are averaged over the levels of: Climate Degrees-of-freedom method: satterthwaite Confidence level used: 0.95 $ pairwise differences of contrast contrast estimate SE df t.ratio p.value long,brain - short,brain long,brain - long,heart long,brain - short,heart short,brain - long,heart short,brain - short,heart long,heart - short,heart Results are averaged over the levels of: Climate P value adjustment: tukey method for comparing a family of 4 estimates Below is a quick plot of the means: > with(hamsterdata,interaction.plot(factor(daylength:climate), Tissue, NI)) mean of NI Tissue brain heart long:cold long:warm short:cold short:warm factor(daylength:climate) 11

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. 22s:173 Combining multiple factors into a single superfactor 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.422 Oehlert)

More information

Workshop 9.3a: Randomized block designs

Workshop 9.3a: Randomized block designs -1- Workshop 93a: Randomized block designs Murray Logan November 23, 16 Table of contents 1 Randomized Block (RCB) designs 1 2 Worked Examples 12 1 Randomized Block (RCB) designs 11 RCB design Simple Randomized

More information

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;

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; STAT:5201 Applied Statistic II (two-way ANOVA with contrasts Two-Factor experiment Drill Speed: 125 and 200 Feed Rate: 0.02, 0.03, 0.05, 0.06 Response: Force All 16 runs were done in random order. This

More information

Repeated Measures Design. Advertising Sales Example

Repeated Measures Design. Advertising Sales Example STAT:5201 Anaylsis/Applied Statistic II Repeated Measures Design Advertising Sales Example A company is interested in comparing the success of two different advertising campaigns. It has 10 test markets,

More information

Stat 5303 (Oehlert): Randomized Complete Blocks 1

Stat 5303 (Oehlert): Randomized Complete Blocks 1 Stat 5303 (Oehlert): Randomized Complete Blocks 1 > library(stat5303libs);library(cfcdae);library(lme4) > immer Loc Var Y1 Y2 1 UF M 81.0 80.7 2 UF S 105.4 82.3 3 UF V 119.7 80.4 4 UF T 109.7 87.2 5 UF

More information

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

Topic 17 - Single Factor Analysis of Variance. Outline. One-way ANOVA. The Data / Notation. One way ANOVA Cell means model Factor effects model Topic 17 - Single Factor Analysis of Variance - Fall 2013 One way ANOVA Cell means model Factor effects model Outline Topic 17 2 One-way ANOVA Response variable Y is continuous Explanatory variable is

More information

Differences of Least Squares Means

Differences of Least Squares Means STAT:5201 Homework 9 Solutions 1. We have a model with two crossed random factors operator and machine. There are 4 operators, 8 machines, and 3 observations from each operator/machine combination. (a)

More information

Mixed Model Theory, Part I

Mixed Model Theory, Part I enote 4 1 enote 4 Mixed Model Theory, Part I enote 4 INDHOLD 2 Indhold 4 Mixed Model Theory, Part I 1 4.1 Design matrix for a systematic linear model.................. 2 4.2 The mixed model.................................

More information

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

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 T-test: means of Spock's judge versus all other judges 1 The TTEST Procedure Variable: pcwomen judge1 N Mean Std Dev Std Err Minimum Maximum OTHER 37 29.4919 7.4308 1.2216 16.5000 48.9000 SPOCKS 9 14.6222

More information

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

This is a Randomized Block Design (RBD) with a single factor treatment arrangement (2 levels) which are fixed. EXST3201 Chapter 13c Geaghan Fall 2005: Page 1 Linear Models Y ij = µ + βi + τ j + βτij + εijk This is a Randomized Block Design (RBD) with a single factor treatment arrangement (2 levels) which are fixed.

More information

Multiple Predictor Variables: ANOVA

Multiple Predictor Variables: ANOVA Multiple Predictor Variables: ANOVA 1/32 Linear Models with Many Predictors Multiple regression has many predictors BUT - so did 1-way ANOVA if treatments had 2 levels What if there are multiple treatment

More information

Topic 32: Two-Way Mixed Effects Model

Topic 32: Two-Way Mixed Effects Model 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

More information

Multi-factor analysis of variance

Multi-factor analysis of variance Faculty of Health Sciences Outline Multi-factor analysis of variance Basic statistics for experimental researchers 2016 Two-way ANOVA and interaction Matched samples ANOVA Random vs systematic variation

More information

Hierarchical Random Effects

Hierarchical Random Effects enote 5 1 enote 5 Hierarchical Random Effects enote 5 INDHOLD 2 Indhold 5 Hierarchical Random Effects 1 5.1 Introduction.................................... 2 5.2 Main example: Lactase measurements in

More information

Lecture 10: Experiments with Random Effects

Lecture 10: Experiments with Random Effects Lecture 10: Experiments with Random Effects Montgomery, Chapter 13 1 Lecture 10 Page 1 Example 1 A textile company weaves a fabric on a large number of looms. It would like the looms to be homogeneous

More information

Topic 20: Single Factor Analysis of Variance

Topic 20: Single Factor Analysis of Variance Topic 20: Single Factor Analysis of Variance Outline Single factor Analysis of Variance One set of treatments Cell means model Factor effects model Link to linear regression using indicator explanatory

More information

Stat 5303 (Oehlert): Balanced Incomplete Block Designs 1

Stat 5303 (Oehlert): Balanced Incomplete Block Designs 1 Stat 5303 (Oehlert): Balanced Incomplete Block Designs 1 > library(stat5303libs);library(cfcdae);library(lme4) > weardata

More information

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

Outline. Topic 19 - Inference. The Cell Means Model. Estimates. Inference for Means Differences in cell means Contrasts. STAT Fall 2013 Topic 19 - Inference - Fall 2013 Outline Inference for Means Differences in cell means Contrasts Multiplicity Topic 19 2 The Cell Means Model Expressed numerically Y ij = µ i + ε ij where µ i is the theoretical

More information

SPH 247 Statistical Analysis of Laboratory Data

SPH 247 Statistical Analysis of Laboratory Data SPH 247 Statistical Analysis of Laboratory Data March 31, 2015 SPH 247 Statistical Analysis of Laboratory Data 1 ANOVA Fixed and Random Effects We will review the analysis of variance (ANOVA) and then

More information

Repeated measures, part 2, advanced methods

Repeated measures, part 2, advanced methods enote 12 1 enote 12 Repeated measures, part 2, advanced methods enote 12 INDHOLD 2 Indhold 12 Repeated measures, part 2, advanced methods 1 12.1 Intro......................................... 3 12.2 A

More information

General Linear Model (Chapter 4)

General Linear Model (Chapter 4) General Linear Model (Chapter 4) Outcome variable is considered continuous Simple linear regression Scatterplots OLS is BLUE under basic assumptions MSE estimates residual variance testing regression coefficients

More information

5.3 Three-Stage Nested Design Example

5.3 Three-Stage Nested Design Example 5.3 Three-Stage Nested Design Example A researcher designs an experiment to study the of a metal alloy. A three-stage nested design was conducted that included Two alloy chemistry compositions. Three ovens

More information

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

SAS Commands. General Plan. Output. Construct scatterplot / interaction plot. Run full model Topic 23 - Unequal Replication Data Model Outline - Fall 2013 Parameter Estimates Inference Topic 23 2 Example Page 954 Data for Two Factor ANOVA Y is the response variable Factor A has levels i = 1, 2,...,

More information

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

Topic 25 - One-Way Random Effects Models. Outline. Random Effects vs Fixed Effects. Data for One-way Random Effects Model. One-way Random effects Topic 5 - One-Way Random Effects Models One-way Random effects Outline Model Variance component estimation - Fall 013 Confidence intervals Topic 5 Random Effects vs Fixed Effects Consider factor with numerous

More information

Multiple Predictor Variables: ANOVA

Multiple Predictor Variables: ANOVA What if you manipulate two factors? Multiple Predictor Variables: ANOVA Block 1 Block 2 Block 3 Block 4 A B C D B C D A C D A B D A B C Randomized Controlled Blocked Design: Design where each treatment

More information

Stat 579: Generalized Linear Models and Extensions

Stat 579: Generalized Linear Models and Extensions Stat 579: Generalized Linear Models and Extensions Linear Mixed Models for Longitudinal Data Yan Lu April, 2018, week 14 1 / 64 Data structure and Model t1 t2 tn i 1st subject y 11 y 12 y 1n1 2nd subject

More information

Unbalanced Data in Factorials Types I, II, III SS Part 2

Unbalanced Data in Factorials Types I, II, III SS Part 2 Unbalanced Data in Factorials Types I, II, III SS Part 2 Chapter 10 in Oehlert STAT:5201 Week 9 - Lecture 2b 1 / 29 Types of sums of squares Type II SS The Type II SS relates to the extra variability explained

More information

Odor attraction CRD Page 1

Odor attraction CRD Page 1 Odor attraction CRD Page 1 dm'log;clear;output;clear'; options ps=512 ls=99 nocenter nodate nonumber nolabel FORMCHAR=" ---- + ---+= -/\*"; ODS LISTING; *** Table 23.2 ********************************************;

More information

df=degrees of freedom = n - 1

df=degrees of freedom = n - 1 One sample t-test test of the mean Assumptions: Independent, random samples Approximately normal distribution (from intro class: σ is unknown, need to calculate and use s (sample standard deviation)) Hypotheses:

More information

Lecture 15 Topic 11: Unbalanced Designs (missing data)

Lecture 15 Topic 11: Unbalanced Designs (missing data) Lecture 15 Topic 11: Unbalanced Designs (missing data) In the real world, things fall apart: plants are destroyed/trampled/eaten animals get sick volunteers quit assistants are sloppy accidents happen

More information

Lecture 4. Random Effects in Completely Randomized Design

Lecture 4. Random Effects in Completely Randomized Design Lecture 4. Random Effects in Completely Randomized Design Montgomery: 3.9, 13.1 and 13.7 1 Lecture 4 Page 1 Random Effects vs Fixed Effects Consider factor with numerous possible levels Want to draw inference

More information

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

Subject-specific observed profiles of log(fev1) vs age First 50 subjects in Six Cities Study Subject-specific observed profiles of log(fev1) vs age First 50 subjects in Six Cities Study 1.4 0.0-6 7 8 9 10 11 12 13 14 15 16 17 18 19 age Model 1: A simple broken stick model with knot at 14 fit with

More information

PLS205 Lab 2 January 15, Laboratory Topic 3

PLS205 Lab 2 January 15, Laboratory Topic 3 PLS205 Lab 2 January 15, 2015 Laboratory Topic 3 General format of ANOVA in SAS Testing the assumption of homogeneity of variances by "/hovtest" by ANOVA of squared residuals Proc Power for ANOVA One-way

More information

1. (Problem 3.4 in OLRT)

1. (Problem 3.4 in OLRT) STAT:5201 Homework 5 Solutions 1. (Problem 3.4 in OLRT) The relationship of the untransformed data is shown below. There does appear to be a decrease in adenine with increased caffeine intake. This is

More information

ANOVA Longitudinal Models for the Practice Effects Data: via GLM

ANOVA Longitudinal Models for the Practice Effects Data: via GLM Psyc 943 Lecture 25 page 1 ANOVA Longitudinal Models for the Practice Effects Data: via GLM Model 1. Saturated Means Model for Session, E-only Variances Model (BP) Variances Model: NO correlation, EQUAL

More information

Sample Size / Power Calculations

Sample Size / Power Calculations Sample Size / Power Calculations A Simple Example Goal: To study the effect of cold on blood pressure (mmhg) in rats Use a Completely Randomized Design (CRD): 12 rats are randomly assigned to one of two

More information

Topic 28: Unequal Replication in Two-Way ANOVA

Topic 28: Unequal Replication in Two-Way ANOVA Topic 28: Unequal Replication in Two-Way ANOVA Outline Two-way ANOVA with unequal numbers of observations in the cells Data and model Regression approach Parameter estimates Previous analyses with constant

More information

Topic 23: Diagnostics and Remedies

Topic 23: Diagnostics and Remedies Topic 23: Diagnostics and Remedies Outline Diagnostics residual checks ANOVA remedial measures Diagnostics Overview We will take the diagnostics and remedial measures that we learned for regression and

More information

Chapter 11. Analysis of Variance (One-Way)

Chapter 11. Analysis of Variance (One-Way) Chapter 11 Analysis of Variance (One-Way) We now develop a statistical procedure for comparing the means of two or more groups, known as analysis of variance or ANOVA. These groups might be the result

More information

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

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

More information

Descriptions of post-hoc tests

Descriptions of post-hoc tests Experimental Statistics II Page 81 Descriptions of post-hoc tests Post-hoc or Post-ANOVA tests! Once you have found out some treatment(s) are different, how do you determine which one(s) are different?

More information

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

20. REML Estimation of Variance Components. Copyright c 2018 (Iowa State University) 20. Statistics / 36 20. REML Estimation of Variance Components Copyright c 2018 (Iowa State University) 20. Statistics 510 1 / 36 Consider the General Linear Model y = Xβ + ɛ, where ɛ N(0, Σ) and Σ is an n n positive definite

More information

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

R Output for Linear Models using functions lm(), gls() & glm() LM 04 lm(), gls() &glm() 1 R Output for Linear Models using functions lm(), gls() & glm() Different kinds of output related to linear models can be obtained in R using function lm() {stats} in the base

More information

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

Analysis of Longitudinal Data: Comparison Between PROC GLM and PROC MIXED. Maribeth Johnson Medical College of Georgia Augusta, GA Analysis of Longitudinal Data: Comparison Between PROC GLM and PROC MIXED Maribeth Johnson Medical College of Georgia Augusta, GA Overview Introduction to longitudinal data Describe the data for examples

More information

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

MIXED MODELS FOR REPEATED (LONGITUDINAL) DATA PART 2 DAVID C. HOWELL 4/1/2010 MIXED MODELS FOR REPEATED (LONGITUDINAL) DATA PART 2 DAVID C. HOWELL 4/1/2010 Part 1 of this document can be found at http://www.uvm.edu/~dhowell/methods/supplements/mixed Models for Repeated Measures1.pdf

More information

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

SAS Syntax and Output for Data Manipulation: CLDP 944 Example 3a page 1 CLDP 944 Example 3a page 1 From Between-Person to Within-Person Models for Longitudinal Data The models for this example come from Hoffman (2015) chapter 3 example 3a. We will be examining the extent to

More information

Simple, Marginal, and Interaction Effects in General Linear Models

Simple, Marginal, and Interaction Effects in General Linear Models Simple, Marginal, and Interaction Effects in General Linear Models PRE 905: Multivariate Analysis Lecture 3 Today s Class Centering and Coding Predictors Interpreting Parameters in the Model for the Means

More information

Other hypotheses of interest (cont d)

Other hypotheses of interest (cont d) Other hypotheses of interest (cont d) In addition to the simple null hypothesis of no treatment effects, we might wish to test other hypothesis of the general form (examples follow): H 0 : C k g β g p

More information

STAT 401A - Statistical Methods for Research Workers

STAT 401A - Statistical Methods for Research Workers STAT 401A - Statistical Methods for Research Workers One-way ANOVA Jarad Niemi (Dr. J) Iowa State University last updated: October 10, 2014 Jarad Niemi (Iowa State) One-way ANOVA October 10, 2014 1 / 39

More information

ANALYSIS OF VARIANCE OF BALANCED DAIRY SCIENCE DATA USING SAS

ANALYSIS OF VARIANCE OF BALANCED DAIRY SCIENCE DATA USING SAS ANALYSIS OF VARIANCE OF BALANCED DAIRY SCIENCE DATA USING SAS Ravinder Malhotra and Vipul Sharma National Dairy Research Institute, Karnal-132001 The most common use of statistics in dairy science is testing

More information

Statistics for exp. medical researchers Comparison of groups, T-tests and ANOVA

Statistics for exp. medical researchers Comparison of groups, T-tests and ANOVA Faculty of Health Sciences Outline Statistics for exp. medical researchers Comparison of groups, T-tests and ANOVA Lene Theil Skovgaard Sept. 14, 2015 Paired comparisons: tests and confidence intervals

More information

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

EXST Regression Techniques Page 1. We can also test the hypothesis H : œ 0 versus H : EXST704 - Regression Techniques Page 1 Using F tests instead of t-tests We can also test the hypothesis H :" œ 0 versus H :" Á 0 with an F test.! " " " F œ MSRegression MSError This test is mathematically

More information

SAS Syntax and Output for Data Manipulation:

SAS Syntax and Output for Data Manipulation: CLP 944 Example 5 page 1 Practice with Fixed and Random Effects of Time in Modeling Within-Person Change The models for this example come from Hoffman (2015) chapter 5. We will be examining the extent

More information

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

STAT 5200 Handout #23. Repeated Measures Example (Ch. 16) Motivating Example: Glucose STAT 500 Handout #3 Repeated Measures Example (Ch. 16) An experiment is conducted to evaluate the effects of three diets on the serum glucose levels of human subjects. Twelve

More information

Answer to exercise: Blood pressure lowering drugs

Answer to exercise: Blood pressure lowering drugs Answer to exercise: Blood pressure lowering drugs The data set bloodpressure.txt contains data from a cross-over trial, involving three different formulations of a drug for lowering of blood pressure:

More information

More about Single Factor Experiments

More about Single Factor Experiments More about Single Factor Experiments 1 2 3 0 / 23 1 2 3 1 / 23 Parameter estimation Effect Model (1): Y ij = µ + A i + ɛ ij, Ji A i = 0 Estimation: µ + A i = y i. ˆµ = y..  i = y i. y.. Effect Modell

More information

PLS205 Lab 6 February 13, Laboratory Topic 9

PLS205 Lab 6 February 13, Laboratory Topic 9 PLS205 Lab 6 February 13, 2014 Laboratory Topic 9 A word about factorials Specifying interactions among factorial effects in SAS The relationship between factors and treatment Interpreting results of an

More information

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

Split-plot Designs. Bruce A Craig. Department of Statistics Purdue University. STAT 514 Topic 21 1 Split-plot Designs Bruce A Craig Department of Statistics Purdue University STAT 514 Topic 21 1 Randomization Defines the Design Want to study the effect of oven temp (3 levels) and amount of baking soda

More information

Simulation and Analysis of Data from a Classic Split Plot Experimental Design

Simulation and Analysis of Data from a Classic Split Plot Experimental Design Simulation and Analysis of Data from a Classic Split Plot Experimental Design 1 Split-Plot Experimental Designs Field Plot Block 1 Block 2 Block 3 Block 4 Genotype C Genotype B Genotype A Genotype B Genotype

More information

Repeated measures, part 1, simple methods

Repeated measures, part 1, simple methods enote 11 1 enote 11 Repeated measures, part 1, simple methods enote 11 INDHOLD 2 Indhold 11 Repeated measures, part 1, simple methods 1 11.1 Intro......................................... 2 11.1.1 Main

More information

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

Two-factor studies. STAT 525 Chapter 19 and 20. Professor Olga Vitek Two-factor studies STAT 525 Chapter 19 and 20 Professor Olga Vitek December 2, 2010 19 Overview Now have two factors (A and B) Suppose each factor has two levels Could analyze as one factor with 4 levels

More information

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

Outline. Topic 22 - Interaction in Two Factor ANOVA. Interaction Not Significant. General Plan Topic 22 - Interaction in Two Factor ANOVA - Fall 2013 Outline Strategies for Analysis when interaction not present when interaction present when n ij = 1 when factor(s) quantitative Topic 22 2 General

More information

Least Squares Analyses of Variance and Covariance

Least Squares Analyses of Variance and Covariance Least Squares Analyses of Variance and Covariance One-Way ANOVA Read Sections 1 and 2 in Chapter 16 of Howell. Run the program ANOVA1- LS.sas, which can be found on my SAS programs page. The data here

More information

Using the lsmeans Package

Using the lsmeans Package Using the lsmeans Package Russell V. Lenth The University of Iowa russell-lenth@uiowa.edu November, 0 Introduction Least-squares means (or LS means), popularized by SAS, are predictions from a linear model

More information

STAT 3A03 Applied Regression Analysis With SAS Fall 2017

STAT 3A03 Applied Regression Analysis With SAS Fall 2017 STAT 3A03 Applied Regression Analysis With SAS Fall 2017 Assignment 5 Solution Set Q. 1 a The code that I used and the output is as follows PROC GLM DataS3A3.Wool plotsnone; Class Amp Len Load; Model CyclesAmp

More information

Temporal Learning: IS50 prior RT

Temporal Learning: IS50 prior RT Temporal Learning: IS50 prior RT Loading required package: Matrix Jihyun Suh 1/27/2016 This data.table install has not detected OpenMP support. It will work but slower in single threaded m Attaching package:

More information

Repeated Measures Data

Repeated Measures Data Repeated Measures Data Mixed Models Lecture Notes By Dr. Hanford page 1 Data where subjects are measured repeatedly over time - predetermined intervals (weekly) - uncontrolled variable intervals between

More information

Stat 6640 Solution to Midterm #2

Stat 6640 Solution to Midterm #2 Stat 6640 Solution to Midterm #2 1. A study was conducted to examine how three statistical software packages used in a statistical course affect the statistical competence a student achieves. At the end

More information

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

Example: Four levels of herbicide strength in an experiment on dry weight of treated plants. The idea of ANOVA Reminders: A factor is a variable that can take one of several levels used to differentiate one group from another. An experiment has a one-way, or completely randomized, design if several

More information

1-Way ANOVA MATH 143. Spring Department of Mathematics and Statistics Calvin College

1-Way ANOVA MATH 143. Spring Department of Mathematics and Statistics Calvin College 1-Way ANOVA MATH 143 Department of Mathematics and Statistics Calvin College Spring 2010 The basic ANOVA situation Two variables: 1 Categorical, 1 Quantitative Main Question: Do the (means of) the quantitative

More information

Mixed models with correlated measurement errors

Mixed models with correlated measurement errors Mixed models with correlated measurement errors Rasmus Waagepetersen October 9, 2018 Example from Department of Health Technology 25 subjects where exposed to electric pulses of 11 different durations

More information

Unbalanced Data in Factorials Types I, II, III SS Part 1

Unbalanced Data in Factorials Types I, II, III SS Part 1 Unbalanced Data in Factorials Types I, II, III SS Part 1 Chapter 10 in Oehlert STAT:5201 Week 9 - Lecture 2 1 / 14 When we perform an ANOVA, we try to quantify the amount of variability in the data accounted

More information

Analysis of Covariance

Analysis of Covariance Analysis of Covariance (ANCOVA) Bruce A Craig Department of Statistics Purdue University STAT 514 Topic 10 1 When to Use ANCOVA In experiment, there is a nuisance factor x that is 1 Correlated with y 2

More information

Lecture 10: Factorial Designs with Random Factors

Lecture 10: Factorial Designs with Random Factors Lecture 10: Factorial Designs with Random Factors Montgomery, Section 13.2 and 13.3 1 Lecture 10 Page 1 Factorial Experiments with Random Effects Lecture 9 has focused on fixed effects Always use MSE in

More information

17. Example SAS Commands for Analysis of a Classic Split-Plot Experiment 17. 1

17. Example SAS Commands for Analysis of a Classic Split-Plot Experiment 17. 1 17 Example SAS Commands for Analysis of a Classic SplitPlot Experiment 17 1 DELIMITED options nocenter nonumber nodate ls80; Format SCREEN OUTPUT proc import datafile"c:\data\simulatedsplitplotdatatxt"

More information

ANOVA (Analysis of Variance) output RLS 11/20/2016

ANOVA (Analysis of Variance) output RLS 11/20/2016 ANOVA (Analysis of Variance) output RLS 11/20/2016 1. Analysis of Variance (ANOVA) The goal of ANOVA is to see if the variation in the data can explain enough to see if there are differences in the means.

More information

Computation of Variances of Functions of Parameter Estimates for Mixed Models in GLM

Computation of Variances of Functions of Parameter Estimates for Mixed Models in GLM Computation of Variances of Functions of Parameter Estimates for Mixed Models in GLM Ramon C. Littell and Stephen B. Linda University of Florida. Introduction Estimates of functions of parameters in linear

More information

One-way ANOVA Model Assumptions

One-way ANOVA Model Assumptions One-way ANOVA Model Assumptions STAT:5201 Week 4: Lecture 1 1 / 31 One-way ANOVA: Model Assumptions Consider the single factor model: Y ij = µ + α }{{} i ij iid with ɛ ij N(0, σ 2 ) mean structure random

More information

Statistics for exp. medical researchers Regression and Correlation

Statistics for exp. medical researchers Regression and Correlation Faculty of Health Sciences Regression analysis Statistics for exp. medical researchers Regression and Correlation Lene Theil Skovgaard Sept. 28, 2015 Linear regression, Estimation and Testing Confidence

More information

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

STA 303H1F: Two-way Analysis of Variance Practice Problems STA 303H1F: Two-way Analysis of Variance Practice Problems 1. In the Pygmalion example from lecture, why are the average scores of the platoon used as the response variable, rather than the scores of the

More information

Using lsmeans. Russell V. Lenth The University of Iowa. November 4, 2017

Using lsmeans. Russell V. Lenth The University of Iowa. November 4, 2017 Using lsmeans Russell V. Lenth The University of Iowa November 4, 2017 Abstract Least-squares means are predictions from a linear model, or averages thereof. They are useful in the analysis of experimental

More information

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

Unbalanced Designs Mechanics. Estimate of σ 2 becomes weighted average of treatment combination sample variances. Unbalanced Designs Mechanics Estimate of σ 2 becomes weighted average of treatment combination sample variances. Types of SS Difference depends on what hypotheses are tested and how differing sample sizes

More information

22s:152 Applied Linear Regression. Take random samples from each of m populations.

22s:152 Applied Linear Regression. Take random samples from each of m populations. 22s:152 Applied Linear Regression Chapter 8: ANOVA NOTE: We will meet in the lab on Monday October 10. One-way ANOVA Focuses on testing for differences among group means. Take random samples from each

More information

A Re-Introduction to General Linear Models (GLM)

A Re-Introduction to General Linear Models (GLM) A Re-Introduction to General Linear Models (GLM) Today s Class: You do know the GLM Estimation (where the numbers in the output come from): From least squares to restricted maximum likelihood (REML) Reviewing

More information

Introduction to SAS proc mixed

Introduction to SAS proc mixed Faculty of Health Sciences Introduction to SAS proc mixed Analysis of repeated measurements, 2017 Julie Forman Department of Biostatistics, University of Copenhagen 2 / 28 Preparing data for analysis The

More information

Multivariate Statistics in Ecology and Quantitative Genetics Summary

Multivariate Statistics in Ecology and Quantitative Genetics Summary Multivariate Statistics in Ecology and Quantitative Genetics Summary Dirk Metzler & Martin Hutzenthaler http://evol.bio.lmu.de/_statgen 5. August 2011 Contents Linear Models Generalized Linear Models Mixed-effects

More information

Lecture 11: Simple Linear Regression

Lecture 11: Simple Linear Regression Lecture 11: Simple Linear Regression Readings: Sections 3.1-3.3, 11.1-11.3 Apr 17, 2009 In linear regression, we examine the association between two quantitative variables. Number of beers that you drink

More information

Week 7.1--IES 612-STA STA doc

Week 7.1--IES 612-STA STA doc Week 7.1--IES 612-STA 4-573-STA 4-576.doc IES 612/STA 4-576 Winter 2009 ANOVA MODELS model adequacy aka RESIDUAL ANALYSIS Numeric data samples from t populations obtained Assume Y ij ~ independent N(μ

More information

22s:152 Applied Linear Regression. There are a couple commonly used models for a one-way ANOVA with m groups. Chapter 8: ANOVA

22s:152 Applied Linear Regression. There are a couple commonly used models for a one-way ANOVA with m groups. Chapter 8: ANOVA 22s:152 Applied Linear Regression Chapter 8: ANOVA NOTE: We will meet in the lab on Monday October 10. One-way ANOVA Focuses on testing for differences among group means. Take random samples from each

More information

STAT 350. Assignment 4

STAT 350. Assignment 4 STAT 350 Assignment 4 1. For the Mileage data in assignment 3 conduct a residual analysis and report your findings. I used the full model for this since my answers to assignment 3 suggested we needed the

More information

Random effects & Repeated measurements

Random effects & Repeated measurements Random effects & Repeated measurements Bo Markussen bomar@math.ku.dk Department of Mathematical Sciences December 20, 2017 LAST (MATH) AS / SmB Day 5 1 / 55 Lecture outline Hypothetical data example: Comparison

More information

FACTORIAL DESIGNS and NESTED DESIGNS

FACTORIAL DESIGNS and NESTED DESIGNS Experimental Design and Statistical Methods Workshop FACTORIAL DESIGNS and NESTED DESIGNS Jesús Piedrafita Arilla jesus.piedrafita@uab.cat Departament de Ciència Animal i dels Aliments Items Factorial

More information

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

13. The Cochran-Satterthwaite Approximation for Linear Combinations of Mean Squares 13. The Cochran-Satterthwaite Approximation for Linear Combinations of Mean Squares opyright c 2018 Dan Nettleton (Iowa State University) 13. Statistics 510 1 / 18 Suppose M 1,..., M k are independent

More information

WITHIN-PARTICIPANT EXPERIMENTAL DESIGNS

WITHIN-PARTICIPANT EXPERIMENTAL DESIGNS 1 WITHIN-PARTICIPANT EXPERIMENTAL DESIGNS I. Single-factor designs: the model is: yij i j ij ij where: yij score for person j under treatment level i (i = 1,..., I; j = 1,..., n) overall mean βi treatment

More information

Lecture 3: Inference in SLR

Lecture 3: Inference in SLR Lecture 3: Inference in SLR STAT 51 Spring 011 Background Reading KNNL:.1.6 3-1 Topic Overview This topic will cover: Review of hypothesis testing Inference about 1 Inference about 0 Confidence Intervals

More information

Statistics 512: Applied Linear Models. Topic 9

Statistics 512: Applied Linear Models. Topic 9 Topic Overview Statistics 51: Applied Linear Models Topic 9 This topic will cover Random vs. Fixed Effects Using E(MS) to obtain appropriate tests in a Random or Mixed Effects Model. Chapter 5: One-way

More information

Analysis of Variance (ANOVA)

Analysis of Variance (ANOVA) Analysis of Variance (ANOVA) Much of statistical inference centers around the ability to distinguish between two or more groups in terms of some underlying response variable y. Sometimes, there are but

More information

The Analysis of Split-Plot Experiments

The Analysis of Split-Plot Experiments enote 7 1 enote 7 The Analysis of Split-Plot Experiments enote 7 INDHOLD 2 Indhold 7 The Analysis of Split-Plot Experiments 1 7.1 Introduction.................................... 2 7.2 The Split-Plot Model...............................

More information

4.8 Alternate Analysis as a Oneway ANOVA

4.8 Alternate Analysis as a Oneway ANOVA 4.8 Alternate Analysis as a Oneway ANOVA Suppose we have data from a two-factor factorial design. The following method can be used to perform a multiple comparison test to compare treatment means as well

More information

Introduction to SAS proc mixed

Introduction to SAS proc mixed Faculty of Health Sciences Introduction to SAS proc mixed Analysis of repeated measurements, 2017 Julie Forman Department of Biostatistics, University of Copenhagen Outline Data in wide and long format

More information