SlideShare a Scribd company logo
Lab 10 – Repeated Measures
October 22 & 23, 2018
FANR 6750
Richard Chandler and Bob Cooper
Overview
Design
• We randomly assign each “subject” to a treatment
• We record the response to the treatment over time
Intro Univariate Split-plot Approach Multivariate 2 / 18
Overview
Design
• We randomly assign each “subject” to a treatment
• We record the response to the treatment over time
Sources of variation
• Treatment
• Time
• Treatment-time interaction
• Random variation among subjects
• Random variation within subjects
Intro Univariate Split-plot Approach Multivariate 2 / 18
Approaches
Univariate
• This is just a split-plot analysis with adjusted p-values
• Adjustments: Greenhouse-Geisser or Huynh-Feldt methods
• In R, you must do a MANOVA to obtain these adjusted
P-values
Intro Univariate Split-plot Approach Multivariate 3 / 18
Approaches
Univariate
• This is just a split-plot analysis with adjusted p-values
• Adjustments: Greenhouse-Geisser or Huynh-Feldt methods
• In R, you must do a MANOVA to obtain these adjusted
P-values
MANOVA
• Testing based on Wilks’ lambda or Pillai’s trace
• This is usually followed by a profile analysis
Intro Univariate Split-plot Approach Multivariate 3 / 18
Approaches
Univariate
• This is just a split-plot analysis with adjusted p-values
• Adjustments: Greenhouse-Geisser or Huynh-Feldt methods
• In R, you must do a MANOVA to obtain these adjusted
P-values
MANOVA
• Testing based on Wilks’ lambda or Pillai’s trace
• This is usually followed by a profile analysis
Mixed effects model with (ARMA) correlation structure
• This can be done using lme
• We might cover this later
Intro Univariate Split-plot Approach Multivariate 3 / 18
The plant data
plantData <- read.csv("plantData.csv")
plantData$plant <- factor(plantData$plant)
plantData$week <- factor(plantData$week)
str(plantData)
## 'data.frame': 50 obs. of 4 variables:
## $ plant : Factor w/ 10 levels "1","2","3","4",..: 1 1 1 1 1 2 2 2 2 2 .
## $ fertilizer: Factor w/ 2 levels "H","L": 2 2 2 2 2 2 2 2 2 2 ...
## $ week : Factor w/ 5 levels "1","2","3","4",..: 1 2 3 4 5 1 2 3 4 5 ..
## $ leaves : int 4 5 6 8 10 3 4 6 6 9 ...
Intro Univariate Split-plot Approach Multivariate 4 / 18
The plant data
plantData <- read.csv("plantData.csv")
plantData$plant <- factor(plantData$plant)
plantData$week <- factor(plantData$week)
str(plantData)
## 'data.frame': 50 obs. of 4 variables:
## $ plant : Factor w/ 10 levels "1","2","3","4",..: 1 1 1 1 1 2 2 2 2 2 .
## $ fertilizer: Factor w/ 2 levels "H","L": 2 2 2 2 2 2 2 2 2 2 ...
## $ week : Factor w/ 5 levels "1","2","3","4",..: 1 2 3 4 5 1 2 3 4 5 ..
## $ leaves : int 4 5 6 8 10 3 4 6 6 9 ...
head(plantData, n=8)
## plant fertilizer week leaves
## 1 1 L 1 4
## 2 1 L 2 5
## 3 1 L 3 6
## 4 1 L 4 8
## 5 1 L 5 10
## 6 2 L 1 3
## 7 2 L 2 4
## 8 2 L 3 6
Intro Univariate Split-plot Approach Multivariate 4 / 18
Leaf Growth
1 2 3 4 5
468101214
Week
Leaves
High fertilizer
Low fertilizer
Intro Univariate Split-plot Approach Multivariate 5 / 18
Univariate split-plot approach
aov1 <- aov(leaves ~ fertilizer*week + Error(plant),
data=plantData)
Intro Univariate Split-plot Approach Multivariate 6 / 18
Univariate split-plot approach
aov1 <- aov(leaves ~ fertilizer*week + Error(plant),
data=plantData)
summary(aov1)
##
## Error: plant
## Df Sum Sq Mean Sq F value Pr(>F)
## fertilizer 1 16.82 16.82 2.604 0.145
## Residuals 8 51.68 6.46
##
## Error: Within
## Df Sum Sq Mean Sq F value Pr(>F)
## week 4 267.40 66.85 158.225 <2e-16 ***
## fertilizer:week 4 5.08 1.27 3.006 0.0326 *
## Residuals 32 13.52 0.42
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Intro Univariate Split-plot Approach Multivariate 6 / 18
Univariate split-plot approach
aov1 <- aov(leaves ~ fertilizer*week + Error(plant),
data=plantData)
summary(aov1)
##
## Error: plant
## Df Sum Sq Mean Sq F value Pr(>F)
## fertilizer 1 16.82 16.82 2.604 0.145
## Residuals 8 51.68 6.46
##
## Error: Within
## Df Sum Sq Mean Sq F value Pr(>F)
## week 4 267.40 66.85 158.225 <2e-16 ***
## fertilizer:week 4 5.08 1.27 3.006 0.0326 *
## Residuals 32 13.52 0.42
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
We need to adjust the p-values for the time and interaction effects
Intro Univariate Split-plot Approach Multivariate 6 / 18
Univariate split-plot approach
aov1 <- aov(leaves ~ fertilizer*week + Error(plant),
data=plantData)
summary(aov1)
##
## Error: plant
## Df Sum Sq Mean Sq F value Pr(>F)
## fertilizer 1 16.82 16.82 2.604 0.145
## Residuals 8 51.68 6.46
##
## Error: Within
## Df Sum Sq Mean Sq F value Pr(>F)
## week 4 267.40 66.85 158.225 <2e-16 ***
## fertilizer:week 4 5.08 1.27 3.006 0.0326 *
## Residuals 32 13.52 0.42
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
We need to adjust the p-values for the time and interaction effects
In R, this requires reformatting the data and running a MANOVA
Intro Univariate Split-plot Approach Multivariate 6 / 18
Format data for MANOVA
plantData2 <- reshape(plantData, idvar="plant",
timevar="week", v.names="leaves",
direction="wide")
Intro Univariate Split-plot Approach Multivariate 7 / 18
Format data for MANOVA
plantData2 <- reshape(plantData, idvar="plant",
timevar="week", v.names="leaves",
direction="wide")
plantData2
## plant fertilizer leaves.1 leaves.2 leaves.3 leaves.4 leaves.5
## 1 1 L 4 5 6 8 10
## 6 2 L 3 4 6 6 9
## 11 3 L 6 7 9 10 12
## 16 4 L 5 7 8 10 12
## 21 5 L 5 6 7 8 10
## 26 6 H 4 6 9 9 11
## 31 7 H 3 5 7 10 12
## 36 8 H 6 8 11 10 14
## 41 9 H 5 7 9 10 12
## 46 10 H 5 8 9 11 11
Intro Univariate Split-plot Approach Multivariate 7 / 18
MANOVA and adjusted P-values
manova1 <- manova(cbind(leaves.1, leaves.2, leaves.3,
leaves.4, leaves.5) ~ fertilizer,
data=plantData2)
Intro Univariate Split-plot Approach Multivariate 8 / 18
MANOVA and adjusted P-values
manova1 <- manova(cbind(leaves.1, leaves.2, leaves.3,
leaves.4, leaves.5) ~ fertilizer,
data=plantData2)
anova(manova1, X=~1, test="Spherical")
## Analysis of Variance Table
##
##
## Contrasts orthogonal to
## ~1
##
## Greenhouse-Geisser epsilon: 0.5882
## Huynh-Feldt epsilon: 0.8490
##
## Df F num Df den Df Pr(>F) G-G Pr H-F Pr
## (Intercept) 1 158.2249 4 32 0.000000 0.000000 0.00000
## fertilizer 1 3.0059 4 32 0.032613 0.066622 0.04224
## Residuals 8
Intro Univariate Split-plot Approach Multivariate 8 / 18
MANOVA and adjusted P-values
manova1 <- manova(cbind(leaves.1, leaves.2, leaves.3,
leaves.4, leaves.5) ~ fertilizer,
data=plantData2)
anova(manova1, X=~1, test="Spherical")
## Analysis of Variance Table
##
##
## Contrasts orthogonal to
## ~1
##
## Greenhouse-Geisser epsilon: 0.5882
## Huynh-Feldt epsilon: 0.8490
##
## Df F num Df den Df Pr(>F) G-G Pr H-F Pr
## (Intercept) 1 158.2249 4 32 0.000000 0.000000 0.00000
## fertilizer 1 3.0059 4 32 0.032613 0.066622 0.04224
## Residuals 8
The last 3 columns are p-values corresponding to the effects of time (Intercept)
and interaction (fertilizer). No adjustment is necessary for the main effect so
you can use the p-value from aov .
Intro Univariate Split-plot Approach Multivariate 8 / 18
An aside – sphericity
Technically, adjusted p-values and MANOVA aren’t necessary if the
assumption of sphericity holds. However, we recommend doing the
adjustments (or the MANOVA) anyway because the test of sphericity has
low power.
Intro Univariate Split-plot Approach Multivariate 9 / 18
An aside – sphericity
Technically, adjusted p-values and MANOVA aren’t necessary if the
assumption of sphericity holds. However, we recommend doing the
adjustments (or the MANOVA) anyway because the test of sphericity has
low power.
Sphericity is the multivariate analogue of the homogeneity of variance
assumption of ANOVA.
Intro Univariate Split-plot Approach Multivariate 9 / 18
An aside – sphericity
Technically, adjusted p-values and MANOVA aren’t necessary if the
assumption of sphericity holds. However, we recommend doing the
adjustments (or the MANOVA) anyway because the test of sphericity has
low power.
Sphericity is the multivariate analogue of the homogeneity of variance
assumption of ANOVA.
Here is how you test the assumption:
mauchly.test(manova1, X=~1)
##
## Mauchly's test of sphericity
## Contrasts orthogonal to
## ~1
##
##
## data: SSD matrix from manova(cbind(leaves.1, leaves.2, leaves.3, leaves.4,
## W = 0.099297, p-value = 0.1062
Intro Univariate Split-plot Approach Multivariate 9 / 18
An aside – sphericity
Technically, adjusted p-values and MANOVA aren’t necessary if the
assumption of sphericity holds. However, we recommend doing the
adjustments (or the MANOVA) anyway because the test of sphericity has
low power.
Sphericity is the multivariate analogue of the homogeneity of variance
assumption of ANOVA.
Here is how you test the assumption:
mauchly.test(manova1, X=~1)
##
## Mauchly's test of sphericity
## Contrasts orthogonal to
## ~1
##
##
## data: SSD matrix from manova(cbind(leaves.1, leaves.2, leaves.3, leaves.4,
## W = 0.099297, p-value = 0.1062
We fail to reject the null hypothesis, so sphericity can be assumed.
Intro Univariate Split-plot Approach Multivariate 9 / 18
Compare aov and manova results
summary(aov1)
##
## Error: plant
## Df Sum Sq Mean Sq F value Pr(>F)
## fertilizer 1 16.82 16.82 2.604 0.145
## Residuals 8 51.68 6.46
##
## Error: Within
## Df Sum Sq Mean Sq F value Pr(>F)
## week 4 267.40 66.85 158.225 <2e-16 ***
## fertilizer:week 4 5.08 1.27 3.006 0.0326 *
## Residuals 32 13.52 0.42
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(manova1, X=~1, test="Spherical")
## Analysis of Variance Table
##
##
## Contrasts orthogonal to
## ~1
##
## Greenhouse-Geisser epsilon: 0.5882
## Huynh-Feldt epsilon: 0.8490
##
## Df F num Df den Df Pr(>F) G-G Pr H-F Pr
## (Intercept) 1 158.2249 4 32 0.000000 0.000000 0.00000
## fertilizer 1 3.0059 4 32 0.032613 0.066622 0.04224
## Residuals 8
Intro Univariate Split-plot Approach Multivariate 10 / 18
Multivariate tests – Wilks’ lambda
An alternative to the adjusted p-value approach is to do a multivariate
analysis relaxing the assumptions about the structure of the
variance-covariance matrix. We’re already most of the way there.
Intro Univariate Split-plot Approach Multivariate 11 / 18
Multivariate tests – Wilks’ lambda
An alternative to the adjusted p-value approach is to do a multivariate
analysis relaxing the assumptions about the structure of the
variance-covariance matrix. We’re already most of the way there.
anova(manova1, X=~1, test="Wilks")
## Analysis of Variance Table
##
##
## Contrasts orthogonal to
## ~1
##
## Df Wilks approx F num Df den Df Pr(>F)
## (Intercept) 1 0.008487 146.042 4 5 2.308e-05 ***
## fertilizer 1 0.144772 7.384 4 5 0.02503 *
## Residuals 8
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Intro Univariate Split-plot Approach Multivariate 11 / 18
Multivariate tests – Wilks’ lambda
An alternative to the adjusted p-value approach is to do a multivariate
analysis relaxing the assumptions about the structure of the
variance-covariance matrix. We’re already most of the way there.
anova(manova1, X=~1, test="Wilks")
## Analysis of Variance Table
##
##
## Contrasts orthogonal to
## ~1
##
## Df Wilks approx F num Df den Df Pr(>F)
## (Intercept) 1 0.008487 146.042 4 5 2.308e-05 ***
## fertilizer 1 0.144772 7.384 4 5 0.02503 *
## Residuals 8
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
As before, we conclude that the effect of fertilizer changes over time
Intro Univariate Split-plot Approach Multivariate 11 / 18
Multivariate tests – Pillai’s trace
Pillai’s trace is an alternative to Wilks’ lambda. In this case, it returns
the same p-values as Wilks’ test.
anova(manova1, X=~1, test="Pillai")
## Analysis of Variance Table
##
##
## Contrasts orthogonal to
## ~1
##
## Df Pillai approx F num Df den Df Pr(>F)
## (Intercept) 1 0.99151 146.042 4 5 2.308e-05 ***
## fertilizer 1 0.85523 7.384 4 5 0.02503 *
## Residuals 8
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Intro Univariate Split-plot Approach Multivariate 12 / 18
Profile analysis
Profile analysis requires calculating the differences (ie, the number
of leaves grown each week).
manova2 <- manova(
cbind(leaves.2-leaves.1, leaves.3-leaves.2,
leaves.4-leaves.3, leaves.5-leaves.4) ~
fertilizer, data=plantData2)
Intro Univariate Split-plot Approach Multivariate 13 / 18
Profile Analysis
During which intervals do the growth rates differ?
Intro Univariate Split-plot Approach Multivariate 14 / 18
Profile Analysis
During which intervals do the growth rates differ?
summary.aov(manova2)
## Response 1 :
## Df Sum Sq Mean Sq F value Pr(>F)
## fertilizer 1 2.5 2.5 12.5 0.00767 **
## Residuals 8 1.6 0.2
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Response 2 :
## Df Sum Sq Mean Sq F value Pr(>F)
## fertilizer 1 1.6 1.6 3.2 0.1114
## Residuals 8 4.0 0.5
##
## Response 3 :
## Df Sum Sq Mean Sq F value Pr(>F)
## fertilizer 1 0.1 0.1 0.0625 0.8089
## Residuals 8 12.8 1.6
##
## Response 4 :
## Df Sum Sq Mean Sq F value Pr(>F)
## fertilizer 1 0.1 0.1 0.0909 0.7707
## Residuals 8 8.8 1.1
Intro Univariate Split-plot Approach Multivariate 14 / 18
Plot the growth rates
Calculate mean growth rate for each time interval
Intro Univariate Split-plot Approach Multivariate 15 / 18
Plot the growth rates
Calculate mean growth rate for each time interval
leavesMat <- plantData2[,3:7]
growthMat <- leavesMat[,2:5] - leavesMat[,1:4]
colnames(growthMat) <- paste("interval", 1:4, sep=".")
(lowFertilizer <- colMeans(growthMat[1:5,]))
## interval.1 interval.2 interval.3 interval.4
## 1.2 1.4 1.2 2.2
(highFertilizer <- colMeans(growthMat[6:10,]))
## interval.1 interval.2 interval.3 interval.4
## 2.2 2.2 1.0 2.0
Intro Univariate Split-plot Approach Multivariate 15 / 18
Plot the growth rates
Calculate mean growth rate for each time interval
leavesMat <- plantData2[,3:7]
growthMat <- leavesMat[,2:5] - leavesMat[,1:4]
colnames(growthMat) <- paste("interval", 1:4, sep=".")
(lowFertilizer <- colMeans(growthMat[1:5,]))
## interval.1 interval.2 interval.3 interval.4
## 1.2 1.4 1.2 2.2
(highFertilizer <- colMeans(growthMat[6:10,]))
## interval.1 interval.2 interval.3 interval.4
## 2.2 2.2 1.0 2.0
Calculate the standard errors for these growth rates
SE <- sqrt(diag(stats:::vcov.mlm(manova2)))
SE <- SE[names(SE)==":(Intercept)"] # Only use "intercept" SEs
unname(SE) ## Ignore the names
## [1] 0.2000000 0.3162278 0.5656854 0.4690416
Intro Univariate Split-plot Approach Multivariate 15 / 18
Plot the growth rates
plot(1:4-0.05, lowFertilizer, type="b", xlim=c(0.9, 4.1),
ylim=c(-1, 4), xaxp=c(1,4,3), cex.lab=1.5,
xlab="Time interval", ylab="Growth rate (leaves/week)")
abline(h=0, lty=3)
arrows(1:4-.05, lowFertilizer-SE, 1:4-.05, lowFertilizer+SE,
angle=90, code=3, length=0.05)
lines(1:4+0.05, highFertilizer, type="b", pch=17, col=4)
arrows(1:4+0.05, highFertilizer-SE, 1:4+0.05,
highFertilizer+SE, angle=90, code=3, length=0.05)
legend(1, 4, c("Low fertilizer", "High fertilizer"),
col=c("black", "blue"), pch=c(1,17))
Intro Univariate Split-plot Approach Multivariate 16 / 18
Plot the growth rates
q
q
q
q
1 2 3 4
−101234
Time interval
Growthrate(leaves/week)
q Low fertilizer
High fertilizer
Intro Univariate Split-plot Approach Multivariate 17 / 18
Assignment
A researcher wants to assess the effects of crowding on the growth of the dark
toadfish (Neophrynichthys latus). 15 fish tanks are stocked with three densities
of conspecifics. Five tanks have low density (1 fish), 5 tanks have medium
density (5 fish), and 5 tanks have high density (10 fish). In each tank, the
weight of one “focal fish” is recorded on 6 consecutive weeks. The data are in
the file fishData.csv.
Intro Univariate Split-plot Approach Multivariate 18 / 18
Assignment
A researcher wants to assess the effects of crowding on the growth of the dark
toadfish (Neophrynichthys latus). 15 fish tanks are stocked with three densities
of conspecifics. Five tanks have low density (1 fish), 5 tanks have medium
density (5 fish), and 5 tanks have high density (10 fish). In each tank, the
weight of one “focal fish” is recorded on 6 consecutive weeks. The data are in
the file fishData.csv.
(1) Conduct the univariate repeated measures ANOVA using aov . Calculate
the adjusted p-values using the Huynh-Feldt method. Does the effect of
density change over time?
(2) Conduct a multivariate repeated measures ANOVA and use Wilks’ lambda
to test if the effect of density changes over time. What is your conclusion?
(3) Conduct a profile analysis. In which time intervals is the effect of density
on growth rate significant?
Intro Univariate Split-plot Approach Multivariate 18 / 18
Assignment
A researcher wants to assess the effects of crowding on the growth of the dark
toadfish (Neophrynichthys latus). 15 fish tanks are stocked with three densities
of conspecifics. Five tanks have low density (1 fish), 5 tanks have medium
density (5 fish), and 5 tanks have high density (10 fish). In each tank, the
weight of one “focal fish” is recorded on 6 consecutive weeks. The data are in
the file fishData.csv.
(1) Conduct the univariate repeated measures ANOVA using aov . Calculate
the adjusted p-values using the Huynh-Feldt method. Does the effect of
density change over time?
(2) Conduct a multivariate repeated measures ANOVA and use Wilks’ lambda
to test if the effect of density changes over time. What is your conclusion?
(3) Conduct a profile analysis. In which time intervals is the effect of density
on growth rate significant?
Upload your self-contained R-script to ELC at least one day before your next lab
Intro Univariate Split-plot Approach Multivariate 18 / 18

More Related Content

PDF
02 designing of experiments and analysis of data in plant genetic resource ma...
PPTX
Analysis of Covariance.pptx
PPTX
Qtl mapping sachin pbt
KEY
Research design
PDF
Analysis of messy data vol i designed experiments 2nd ed
PPTX
PPTX
Simple correlation & Regression analysis
PPT
02 designing of experiments and analysis of data in plant genetic resource ma...
Analysis of Covariance.pptx
Qtl mapping sachin pbt
Research design
Analysis of messy data vol i designed experiments 2nd ed
Simple correlation & Regression analysis

What's hot (20)

PPT
Path Analysis
PPT
Paired t Test
PPTX
Anova; analysis of variance
PPT
5 factorial design
PPTX
Non Parametric Tests
PDF
Probability Distributions
PPTX
4.4. effect modification
 
PDF
5. Non parametric analysis
PDF
Propensity Score Matching Methods
PDF
Probability - I
PPTX
Goodness of-fit
PPT
Doe07 bibd
PPTX
Stability analysis and G*E interactions in plants
PDF
Normality tests
PPTX
Statistics an introduction (1)
PPTX
Molecular basis of heterosis in crop plants
PDF
Introduction of mixed effect model
PPTX
Measuring of risk
PDF
9. Regression
Path Analysis
Paired t Test
Anova; analysis of variance
5 factorial design
Non Parametric Tests
Probability Distributions
4.4. effect modification
 
5. Non parametric analysis
Propensity Score Matching Methods
Probability - I
Goodness of-fit
Doe07 bibd
Stability analysis and G*E interactions in plants
Normality tests
Statistics an introduction (1)
Molecular basis of heterosis in crop plants
Introduction of mixed effect model
Measuring of risk
9. Regression
Ad

Similar to Repeated measures analysis in R (20)

PDF
Blocking lab
PPTX
linear models.pptx
PDF
Assumptions of ANOVA
PDF
ANCOVA in R
PDF
Split-plot Designs
PDF
A note on estimation of population mean in sample survey using auxiliary info...
PPT
Biom-32-GxE I.ppt
PPT
10.Analysis of Variance.ppt
PPTX
Analysis of Variance (ANOVA), MANOVA: Expected variance components, Random an...
PDF
One-way ANOVA
PPTX
Variance component analysis by paravayya c pujeri
PPT
U1.4-RVDistributiofdgdddddddddddddddddddddddns (1).ppt
PPT
U1.4-RVDistributions.pptx distributionss
PPT
U1.4-RVDistributions.pptxxxxxx distributions
PPT
U1.4- RV Distributions with Examples.ppt
PPT
U1.4-RVDistributions.ppt
PPT
Statistical Distributions normal binary.ppt
PPT
UMBC Research Day Presentation
PDF
Nested Designs
PPTX
SAS Notes
Blocking lab
linear models.pptx
Assumptions of ANOVA
ANCOVA in R
Split-plot Designs
A note on estimation of population mean in sample survey using auxiliary info...
Biom-32-GxE I.ppt
10.Analysis of Variance.ppt
Analysis of Variance (ANOVA), MANOVA: Expected variance components, Random an...
One-way ANOVA
Variance component analysis by paravayya c pujeri
U1.4-RVDistributiofdgdddddddddddddddddddddddns (1).ppt
U1.4-RVDistributions.pptx distributionss
U1.4-RVDistributions.pptxxxxxx distributions
U1.4- RV Distributions with Examples.ppt
U1.4-RVDistributions.ppt
Statistical Distributions normal binary.ppt
UMBC Research Day Presentation
Nested Designs
SAS Notes
Ad

More from richardchandler (11)

PDF
Model Selection and Multi-model Inference
PDF
Introduction to Generalized Linear Models
PDF
Introduction to statistical modeling in R
PDF
Factorial designs
PDF
Lab on contrasts, estimation, and power
PDF
t-tests in R - Lab slides for UGA course FANR 6750
PDF
Introduction to R - Lab slides for UGA course FANR 6750
PDF
Hierarchichal species distributions model and Maxent
PDF
Slides from ESA 2015
PDF
The role of spatial models in applied ecological research
PDF
2014 ISEC slides
Model Selection and Multi-model Inference
Introduction to Generalized Linear Models
Introduction to statistical modeling in R
Factorial designs
Lab on contrasts, estimation, and power
t-tests in R - Lab slides for UGA course FANR 6750
Introduction to R - Lab slides for UGA course FANR 6750
Hierarchichal species distributions model and Maxent
Slides from ESA 2015
The role of spatial models in applied ecological research
2014 ISEC slides

Recently uploaded (20)

PPTX
DRUG THERAPY FOR SHOCK gjjjgfhhhhh.pptx.
PDF
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
PPT
POSITIONING IN OPERATION THEATRE ROOM.ppt
PPT
protein biochemistry.ppt for university classes
PPTX
2Systematics of Living Organisms t-.pptx
PPTX
2. Earth - The Living Planet earth and life
PDF
An interstellar mission to test astrophysical black holes
PDF
Formation of Supersonic Turbulence in the Primordial Star-forming Cloud
PPTX
2. Earth - The Living Planet Module 2ELS
PPTX
Classification Systems_TAXONOMY_SCIENCE8.pptx
PDF
HPLC-PPT.docx high performance liquid chromatography
PPTX
7. General Toxicologyfor clinical phrmacy.pptx
PPTX
Taita Taveta Laboratory Technician Workshop Presentation.pptx
PPTX
Protein & Amino Acid Structures Levels of protein structure (primary, seconda...
PPTX
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
PPTX
BIOMOLECULES PPT........................
PPT
The World of Physical Science, • Labs: Safety Simulation, Measurement Practice
PPTX
Comparative Structure of Integument in Vertebrates.pptx
PPTX
neck nodes and dissection types and lymph nodes levels
PPTX
TOTAL hIP ARTHROPLASTY Presentation.pptx
DRUG THERAPY FOR SHOCK gjjjgfhhhhh.pptx.
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
POSITIONING IN OPERATION THEATRE ROOM.ppt
protein biochemistry.ppt for university classes
2Systematics of Living Organisms t-.pptx
2. Earth - The Living Planet earth and life
An interstellar mission to test astrophysical black holes
Formation of Supersonic Turbulence in the Primordial Star-forming Cloud
2. Earth - The Living Planet Module 2ELS
Classification Systems_TAXONOMY_SCIENCE8.pptx
HPLC-PPT.docx high performance liquid chromatography
7. General Toxicologyfor clinical phrmacy.pptx
Taita Taveta Laboratory Technician Workshop Presentation.pptx
Protein & Amino Acid Structures Levels of protein structure (primary, seconda...
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
BIOMOLECULES PPT........................
The World of Physical Science, • Labs: Safety Simulation, Measurement Practice
Comparative Structure of Integument in Vertebrates.pptx
neck nodes and dissection types and lymph nodes levels
TOTAL hIP ARTHROPLASTY Presentation.pptx

Repeated measures analysis in R

  • 1. Lab 10 – Repeated Measures October 22 & 23, 2018 FANR 6750 Richard Chandler and Bob Cooper
  • 2. Overview Design • We randomly assign each “subject” to a treatment • We record the response to the treatment over time Intro Univariate Split-plot Approach Multivariate 2 / 18
  • 3. Overview Design • We randomly assign each “subject” to a treatment • We record the response to the treatment over time Sources of variation • Treatment • Time • Treatment-time interaction • Random variation among subjects • Random variation within subjects Intro Univariate Split-plot Approach Multivariate 2 / 18
  • 4. Approaches Univariate • This is just a split-plot analysis with adjusted p-values • Adjustments: Greenhouse-Geisser or Huynh-Feldt methods • In R, you must do a MANOVA to obtain these adjusted P-values Intro Univariate Split-plot Approach Multivariate 3 / 18
  • 5. Approaches Univariate • This is just a split-plot analysis with adjusted p-values • Adjustments: Greenhouse-Geisser or Huynh-Feldt methods • In R, you must do a MANOVA to obtain these adjusted P-values MANOVA • Testing based on Wilks’ lambda or Pillai’s trace • This is usually followed by a profile analysis Intro Univariate Split-plot Approach Multivariate 3 / 18
  • 6. Approaches Univariate • This is just a split-plot analysis with adjusted p-values • Adjustments: Greenhouse-Geisser or Huynh-Feldt methods • In R, you must do a MANOVA to obtain these adjusted P-values MANOVA • Testing based on Wilks’ lambda or Pillai’s trace • This is usually followed by a profile analysis Mixed effects model with (ARMA) correlation structure • This can be done using lme • We might cover this later Intro Univariate Split-plot Approach Multivariate 3 / 18
  • 7. The plant data plantData <- read.csv("plantData.csv") plantData$plant <- factor(plantData$plant) plantData$week <- factor(plantData$week) str(plantData) ## 'data.frame': 50 obs. of 4 variables: ## $ plant : Factor w/ 10 levels "1","2","3","4",..: 1 1 1 1 1 2 2 2 2 2 . ## $ fertilizer: Factor w/ 2 levels "H","L": 2 2 2 2 2 2 2 2 2 2 ... ## $ week : Factor w/ 5 levels "1","2","3","4",..: 1 2 3 4 5 1 2 3 4 5 .. ## $ leaves : int 4 5 6 8 10 3 4 6 6 9 ... Intro Univariate Split-plot Approach Multivariate 4 / 18
  • 8. The plant data plantData <- read.csv("plantData.csv") plantData$plant <- factor(plantData$plant) plantData$week <- factor(plantData$week) str(plantData) ## 'data.frame': 50 obs. of 4 variables: ## $ plant : Factor w/ 10 levels "1","2","3","4",..: 1 1 1 1 1 2 2 2 2 2 . ## $ fertilizer: Factor w/ 2 levels "H","L": 2 2 2 2 2 2 2 2 2 2 ... ## $ week : Factor w/ 5 levels "1","2","3","4",..: 1 2 3 4 5 1 2 3 4 5 .. ## $ leaves : int 4 5 6 8 10 3 4 6 6 9 ... head(plantData, n=8) ## plant fertilizer week leaves ## 1 1 L 1 4 ## 2 1 L 2 5 ## 3 1 L 3 6 ## 4 1 L 4 8 ## 5 1 L 5 10 ## 6 2 L 1 3 ## 7 2 L 2 4 ## 8 2 L 3 6 Intro Univariate Split-plot Approach Multivariate 4 / 18
  • 9. Leaf Growth 1 2 3 4 5 468101214 Week Leaves High fertilizer Low fertilizer Intro Univariate Split-plot Approach Multivariate 5 / 18
  • 10. Univariate split-plot approach aov1 <- aov(leaves ~ fertilizer*week + Error(plant), data=plantData) Intro Univariate Split-plot Approach Multivariate 6 / 18
  • 11. Univariate split-plot approach aov1 <- aov(leaves ~ fertilizer*week + Error(plant), data=plantData) summary(aov1) ## ## Error: plant ## Df Sum Sq Mean Sq F value Pr(>F) ## fertilizer 1 16.82 16.82 2.604 0.145 ## Residuals 8 51.68 6.46 ## ## Error: Within ## Df Sum Sq Mean Sq F value Pr(>F) ## week 4 267.40 66.85 158.225 <2e-16 *** ## fertilizer:week 4 5.08 1.27 3.006 0.0326 * ## Residuals 32 13.52 0.42 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Intro Univariate Split-plot Approach Multivariate 6 / 18
  • 12. Univariate split-plot approach aov1 <- aov(leaves ~ fertilizer*week + Error(plant), data=plantData) summary(aov1) ## ## Error: plant ## Df Sum Sq Mean Sq F value Pr(>F) ## fertilizer 1 16.82 16.82 2.604 0.145 ## Residuals 8 51.68 6.46 ## ## Error: Within ## Df Sum Sq Mean Sq F value Pr(>F) ## week 4 267.40 66.85 158.225 <2e-16 *** ## fertilizer:week 4 5.08 1.27 3.006 0.0326 * ## Residuals 32 13.52 0.42 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 We need to adjust the p-values for the time and interaction effects Intro Univariate Split-plot Approach Multivariate 6 / 18
  • 13. Univariate split-plot approach aov1 <- aov(leaves ~ fertilizer*week + Error(plant), data=plantData) summary(aov1) ## ## Error: plant ## Df Sum Sq Mean Sq F value Pr(>F) ## fertilizer 1 16.82 16.82 2.604 0.145 ## Residuals 8 51.68 6.46 ## ## Error: Within ## Df Sum Sq Mean Sq F value Pr(>F) ## week 4 267.40 66.85 158.225 <2e-16 *** ## fertilizer:week 4 5.08 1.27 3.006 0.0326 * ## Residuals 32 13.52 0.42 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 We need to adjust the p-values for the time and interaction effects In R, this requires reformatting the data and running a MANOVA Intro Univariate Split-plot Approach Multivariate 6 / 18
  • 14. Format data for MANOVA plantData2 <- reshape(plantData, idvar="plant", timevar="week", v.names="leaves", direction="wide") Intro Univariate Split-plot Approach Multivariate 7 / 18
  • 15. Format data for MANOVA plantData2 <- reshape(plantData, idvar="plant", timevar="week", v.names="leaves", direction="wide") plantData2 ## plant fertilizer leaves.1 leaves.2 leaves.3 leaves.4 leaves.5 ## 1 1 L 4 5 6 8 10 ## 6 2 L 3 4 6 6 9 ## 11 3 L 6 7 9 10 12 ## 16 4 L 5 7 8 10 12 ## 21 5 L 5 6 7 8 10 ## 26 6 H 4 6 9 9 11 ## 31 7 H 3 5 7 10 12 ## 36 8 H 6 8 11 10 14 ## 41 9 H 5 7 9 10 12 ## 46 10 H 5 8 9 11 11 Intro Univariate Split-plot Approach Multivariate 7 / 18
  • 16. MANOVA and adjusted P-values manova1 <- manova(cbind(leaves.1, leaves.2, leaves.3, leaves.4, leaves.5) ~ fertilizer, data=plantData2) Intro Univariate Split-plot Approach Multivariate 8 / 18
  • 17. MANOVA and adjusted P-values manova1 <- manova(cbind(leaves.1, leaves.2, leaves.3, leaves.4, leaves.5) ~ fertilizer, data=plantData2) anova(manova1, X=~1, test="Spherical") ## Analysis of Variance Table ## ## ## Contrasts orthogonal to ## ~1 ## ## Greenhouse-Geisser epsilon: 0.5882 ## Huynh-Feldt epsilon: 0.8490 ## ## Df F num Df den Df Pr(>F) G-G Pr H-F Pr ## (Intercept) 1 158.2249 4 32 0.000000 0.000000 0.00000 ## fertilizer 1 3.0059 4 32 0.032613 0.066622 0.04224 ## Residuals 8 Intro Univariate Split-plot Approach Multivariate 8 / 18
  • 18. MANOVA and adjusted P-values manova1 <- manova(cbind(leaves.1, leaves.2, leaves.3, leaves.4, leaves.5) ~ fertilizer, data=plantData2) anova(manova1, X=~1, test="Spherical") ## Analysis of Variance Table ## ## ## Contrasts orthogonal to ## ~1 ## ## Greenhouse-Geisser epsilon: 0.5882 ## Huynh-Feldt epsilon: 0.8490 ## ## Df F num Df den Df Pr(>F) G-G Pr H-F Pr ## (Intercept) 1 158.2249 4 32 0.000000 0.000000 0.00000 ## fertilizer 1 3.0059 4 32 0.032613 0.066622 0.04224 ## Residuals 8 The last 3 columns are p-values corresponding to the effects of time (Intercept) and interaction (fertilizer). No adjustment is necessary for the main effect so you can use the p-value from aov . Intro Univariate Split-plot Approach Multivariate 8 / 18
  • 19. An aside – sphericity Technically, adjusted p-values and MANOVA aren’t necessary if the assumption of sphericity holds. However, we recommend doing the adjustments (or the MANOVA) anyway because the test of sphericity has low power. Intro Univariate Split-plot Approach Multivariate 9 / 18
  • 20. An aside – sphericity Technically, adjusted p-values and MANOVA aren’t necessary if the assumption of sphericity holds. However, we recommend doing the adjustments (or the MANOVA) anyway because the test of sphericity has low power. Sphericity is the multivariate analogue of the homogeneity of variance assumption of ANOVA. Intro Univariate Split-plot Approach Multivariate 9 / 18
  • 21. An aside – sphericity Technically, adjusted p-values and MANOVA aren’t necessary if the assumption of sphericity holds. However, we recommend doing the adjustments (or the MANOVA) anyway because the test of sphericity has low power. Sphericity is the multivariate analogue of the homogeneity of variance assumption of ANOVA. Here is how you test the assumption: mauchly.test(manova1, X=~1) ## ## Mauchly's test of sphericity ## Contrasts orthogonal to ## ~1 ## ## ## data: SSD matrix from manova(cbind(leaves.1, leaves.2, leaves.3, leaves.4, ## W = 0.099297, p-value = 0.1062 Intro Univariate Split-plot Approach Multivariate 9 / 18
  • 22. An aside – sphericity Technically, adjusted p-values and MANOVA aren’t necessary if the assumption of sphericity holds. However, we recommend doing the adjustments (or the MANOVA) anyway because the test of sphericity has low power. Sphericity is the multivariate analogue of the homogeneity of variance assumption of ANOVA. Here is how you test the assumption: mauchly.test(manova1, X=~1) ## ## Mauchly's test of sphericity ## Contrasts orthogonal to ## ~1 ## ## ## data: SSD matrix from manova(cbind(leaves.1, leaves.2, leaves.3, leaves.4, ## W = 0.099297, p-value = 0.1062 We fail to reject the null hypothesis, so sphericity can be assumed. Intro Univariate Split-plot Approach Multivariate 9 / 18
  • 23. Compare aov and manova results summary(aov1) ## ## Error: plant ## Df Sum Sq Mean Sq F value Pr(>F) ## fertilizer 1 16.82 16.82 2.604 0.145 ## Residuals 8 51.68 6.46 ## ## Error: Within ## Df Sum Sq Mean Sq F value Pr(>F) ## week 4 267.40 66.85 158.225 <2e-16 *** ## fertilizer:week 4 5.08 1.27 3.006 0.0326 * ## Residuals 32 13.52 0.42 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 anova(manova1, X=~1, test="Spherical") ## Analysis of Variance Table ## ## ## Contrasts orthogonal to ## ~1 ## ## Greenhouse-Geisser epsilon: 0.5882 ## Huynh-Feldt epsilon: 0.8490 ## ## Df F num Df den Df Pr(>F) G-G Pr H-F Pr ## (Intercept) 1 158.2249 4 32 0.000000 0.000000 0.00000 ## fertilizer 1 3.0059 4 32 0.032613 0.066622 0.04224 ## Residuals 8 Intro Univariate Split-plot Approach Multivariate 10 / 18
  • 24. Multivariate tests – Wilks’ lambda An alternative to the adjusted p-value approach is to do a multivariate analysis relaxing the assumptions about the structure of the variance-covariance matrix. We’re already most of the way there. Intro Univariate Split-plot Approach Multivariate 11 / 18
  • 25. Multivariate tests – Wilks’ lambda An alternative to the adjusted p-value approach is to do a multivariate analysis relaxing the assumptions about the structure of the variance-covariance matrix. We’re already most of the way there. anova(manova1, X=~1, test="Wilks") ## Analysis of Variance Table ## ## ## Contrasts orthogonal to ## ~1 ## ## Df Wilks approx F num Df den Df Pr(>F) ## (Intercept) 1 0.008487 146.042 4 5 2.308e-05 *** ## fertilizer 1 0.144772 7.384 4 5 0.02503 * ## Residuals 8 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Intro Univariate Split-plot Approach Multivariate 11 / 18
  • 26. Multivariate tests – Wilks’ lambda An alternative to the adjusted p-value approach is to do a multivariate analysis relaxing the assumptions about the structure of the variance-covariance matrix. We’re already most of the way there. anova(manova1, X=~1, test="Wilks") ## Analysis of Variance Table ## ## ## Contrasts orthogonal to ## ~1 ## ## Df Wilks approx F num Df den Df Pr(>F) ## (Intercept) 1 0.008487 146.042 4 5 2.308e-05 *** ## fertilizer 1 0.144772 7.384 4 5 0.02503 * ## Residuals 8 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 As before, we conclude that the effect of fertilizer changes over time Intro Univariate Split-plot Approach Multivariate 11 / 18
  • 27. Multivariate tests – Pillai’s trace Pillai’s trace is an alternative to Wilks’ lambda. In this case, it returns the same p-values as Wilks’ test. anova(manova1, X=~1, test="Pillai") ## Analysis of Variance Table ## ## ## Contrasts orthogonal to ## ~1 ## ## Df Pillai approx F num Df den Df Pr(>F) ## (Intercept) 1 0.99151 146.042 4 5 2.308e-05 *** ## fertilizer 1 0.85523 7.384 4 5 0.02503 * ## Residuals 8 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Intro Univariate Split-plot Approach Multivariate 12 / 18
  • 28. Profile analysis Profile analysis requires calculating the differences (ie, the number of leaves grown each week). manova2 <- manova( cbind(leaves.2-leaves.1, leaves.3-leaves.2, leaves.4-leaves.3, leaves.5-leaves.4) ~ fertilizer, data=plantData2) Intro Univariate Split-plot Approach Multivariate 13 / 18
  • 29. Profile Analysis During which intervals do the growth rates differ? Intro Univariate Split-plot Approach Multivariate 14 / 18
  • 30. Profile Analysis During which intervals do the growth rates differ? summary.aov(manova2) ## Response 1 : ## Df Sum Sq Mean Sq F value Pr(>F) ## fertilizer 1 2.5 2.5 12.5 0.00767 ** ## Residuals 8 1.6 0.2 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## ## Response 2 : ## Df Sum Sq Mean Sq F value Pr(>F) ## fertilizer 1 1.6 1.6 3.2 0.1114 ## Residuals 8 4.0 0.5 ## ## Response 3 : ## Df Sum Sq Mean Sq F value Pr(>F) ## fertilizer 1 0.1 0.1 0.0625 0.8089 ## Residuals 8 12.8 1.6 ## ## Response 4 : ## Df Sum Sq Mean Sq F value Pr(>F) ## fertilizer 1 0.1 0.1 0.0909 0.7707 ## Residuals 8 8.8 1.1 Intro Univariate Split-plot Approach Multivariate 14 / 18
  • 31. Plot the growth rates Calculate mean growth rate for each time interval Intro Univariate Split-plot Approach Multivariate 15 / 18
  • 32. Plot the growth rates Calculate mean growth rate for each time interval leavesMat <- plantData2[,3:7] growthMat <- leavesMat[,2:5] - leavesMat[,1:4] colnames(growthMat) <- paste("interval", 1:4, sep=".") (lowFertilizer <- colMeans(growthMat[1:5,])) ## interval.1 interval.2 interval.3 interval.4 ## 1.2 1.4 1.2 2.2 (highFertilizer <- colMeans(growthMat[6:10,])) ## interval.1 interval.2 interval.3 interval.4 ## 2.2 2.2 1.0 2.0 Intro Univariate Split-plot Approach Multivariate 15 / 18
  • 33. Plot the growth rates Calculate mean growth rate for each time interval leavesMat <- plantData2[,3:7] growthMat <- leavesMat[,2:5] - leavesMat[,1:4] colnames(growthMat) <- paste("interval", 1:4, sep=".") (lowFertilizer <- colMeans(growthMat[1:5,])) ## interval.1 interval.2 interval.3 interval.4 ## 1.2 1.4 1.2 2.2 (highFertilizer <- colMeans(growthMat[6:10,])) ## interval.1 interval.2 interval.3 interval.4 ## 2.2 2.2 1.0 2.0 Calculate the standard errors for these growth rates SE <- sqrt(diag(stats:::vcov.mlm(manova2))) SE <- SE[names(SE)==":(Intercept)"] # Only use "intercept" SEs unname(SE) ## Ignore the names ## [1] 0.2000000 0.3162278 0.5656854 0.4690416 Intro Univariate Split-plot Approach Multivariate 15 / 18
  • 34. Plot the growth rates plot(1:4-0.05, lowFertilizer, type="b", xlim=c(0.9, 4.1), ylim=c(-1, 4), xaxp=c(1,4,3), cex.lab=1.5, xlab="Time interval", ylab="Growth rate (leaves/week)") abline(h=0, lty=3) arrows(1:4-.05, lowFertilizer-SE, 1:4-.05, lowFertilizer+SE, angle=90, code=3, length=0.05) lines(1:4+0.05, highFertilizer, type="b", pch=17, col=4) arrows(1:4+0.05, highFertilizer-SE, 1:4+0.05, highFertilizer+SE, angle=90, code=3, length=0.05) legend(1, 4, c("Low fertilizer", "High fertilizer"), col=c("black", "blue"), pch=c(1,17)) Intro Univariate Split-plot Approach Multivariate 16 / 18
  • 35. Plot the growth rates q q q q 1 2 3 4 −101234 Time interval Growthrate(leaves/week) q Low fertilizer High fertilizer Intro Univariate Split-plot Approach Multivariate 17 / 18
  • 36. Assignment A researcher wants to assess the effects of crowding on the growth of the dark toadfish (Neophrynichthys latus). 15 fish tanks are stocked with three densities of conspecifics. Five tanks have low density (1 fish), 5 tanks have medium density (5 fish), and 5 tanks have high density (10 fish). In each tank, the weight of one “focal fish” is recorded on 6 consecutive weeks. The data are in the file fishData.csv. Intro Univariate Split-plot Approach Multivariate 18 / 18
  • 37. Assignment A researcher wants to assess the effects of crowding on the growth of the dark toadfish (Neophrynichthys latus). 15 fish tanks are stocked with three densities of conspecifics. Five tanks have low density (1 fish), 5 tanks have medium density (5 fish), and 5 tanks have high density (10 fish). In each tank, the weight of one “focal fish” is recorded on 6 consecutive weeks. The data are in the file fishData.csv. (1) Conduct the univariate repeated measures ANOVA using aov . Calculate the adjusted p-values using the Huynh-Feldt method. Does the effect of density change over time? (2) Conduct a multivariate repeated measures ANOVA and use Wilks’ lambda to test if the effect of density changes over time. What is your conclusion? (3) Conduct a profile analysis. In which time intervals is the effect of density on growth rate significant? Intro Univariate Split-plot Approach Multivariate 18 / 18
  • 38. Assignment A researcher wants to assess the effects of crowding on the growth of the dark toadfish (Neophrynichthys latus). 15 fish tanks are stocked with three densities of conspecifics. Five tanks have low density (1 fish), 5 tanks have medium density (5 fish), and 5 tanks have high density (10 fish). In each tank, the weight of one “focal fish” is recorded on 6 consecutive weeks. The data are in the file fishData.csv. (1) Conduct the univariate repeated measures ANOVA using aov . Calculate the adjusted p-values using the Huynh-Feldt method. Does the effect of density change over time? (2) Conduct a multivariate repeated measures ANOVA and use Wilks’ lambda to test if the effect of density changes over time. What is your conclusion? (3) Conduct a profile analysis. In which time intervals is the effect of density on growth rate significant? Upload your self-contained R-script to ELC at least one day before your next lab Intro Univariate Split-plot Approach Multivariate 18 / 18