SlideShare a Scribd company logo
1 of 37
Download to read offline
Lab 4 – Contrasts, Estimation, and
Power Analysis
September 10 & 11, 2018
FANR 6750
Richard Chandler and Bob Cooper
University of Georgia
Today’s Topics
1 Contrasts
2 Estimation
3 Power
Today’s Topics
1 Contrasts
2 Estimation
3 Power
Chain Saw Data
sawData <- read.csv("sawData.csv")
sawData
## y Brand
## 1 42 A
## 2 17 A
## 3 24 A
## 4 39 A
## 5 43 A
## 6 28 B
## 7 50 B
## 8 44 B
## 9 32 B
## 10 61 B
## 11 57 C
## 12 45 C
## 13 48 C
## 14 41 C
## 15 54 C
## 16 29 D
## 17 40 D
## 18 22 D
## 19 34 D
## 20 30 D
Contrasts Estimation Power 3 / 18
Contrasts
Suppose we want to make 3 a priori comparisons:
(1) Groups A&D vs B&C
(2) Groups A vs D
(3) Groups B vs C
Contrasts Estimation Power 4 / 18
Contrasts
Suppose we want to make 3 a priori comparisons:
(1) Groups A&D vs B&C
(2) Groups A vs D
(3) Groups B vs C
Comparison Null hypothesis
1 AD vs BC µA+µD
2 − µB+µC
2 = 0
2 A vs D µA − µD = 0
3 B vs C µB − µC = 0
Contrasts Estimation Power 4 / 18
Constructing contrasts in R
Coefficients
ADvBC <- c(1/2, -1/2, -1/2, 1/2)
AvD <- c(1, 0, 0, -1)
BvC <- c(0, 1, -1, 0)
Contrasts Estimation Power 5 / 18
Constructing contrasts in R
Coefficients
ADvBC <- c(1/2, -1/2, -1/2, 1/2)
AvD <- c(1, 0, 0, -1)
BvC <- c(0, 1, -1, 0)
Are they orthogonal?
Contrasts Estimation Power 5 / 18
Constructing contrasts in R
Coefficients
ADvBC <- c(1/2, -1/2, -1/2, 1/2)
AvD <- c(1, 0, 0, -1)
BvC <- c(0, 1, -1, 0)
Are they orthogonal?
sum(ADvBC)
## [1] 0
sum(AvD)
## [1] 0
sum(BvC)
## [1] 0
Contrasts Estimation Power 5 / 18
Constructing contrasts in R
Coefficients
ADvBC <- c(1/2, -1/2, -1/2, 1/2)
AvD <- c(1, 0, 0, -1)
BvC <- c(0, 1, -1, 0)
Are they orthogonal?
sum(ADvBC)
## [1] 0
sum(AvD)
## [1] 0
sum(BvC)
## [1] 0
sum(ADvBC * AvD)
## [1] 0
sum(ADvBC * BvC)
## [1] 0
sum(AvD * BvC)
## [1] 0
Contrasts Estimation Power 5 / 18
Constructing contrasts in R
Coefficients
ADvBC <- c(1/2, -1/2, -1/2, 1/2)
AvD <- c(1, 0, 0, -1)
BvC <- c(0, 1, -1, 0)
Are they orthogonal?
sum(ADvBC)
## [1] 0
sum(AvD)
## [1] 0
sum(BvC)
## [1] 0
sum(ADvBC * AvD)
## [1] 0
sum(ADvBC * BvC)
## [1] 0
sum(AvD * BvC)
## [1] 0
Yes, they are.
Contrasts Estimation Power 5 / 18
We need to put the contrasts into a matrix
To use contrasts in R, each set of coefficients must be
formatted as a column in a matrix.
Contrasts Estimation Power 6 / 18
We need to put the contrasts into a matrix
To use contrasts in R, each set of coefficients must be
formatted as a column in a matrix.
We can use cbind for this:
contrast.mat <- cbind(ADvBC, AvD, BvC)
contrast.mat
## ADvBC AvD BvC
## [1,] 0.5 1 0
## [2,] -0.5 0 1
## [3,] -0.5 0 -1
## [4,] 0.5 -1 0
Contrasts Estimation Power 6 / 18
Contrasts
Fit the model with contrasts
aov.out <- aov(y ~ Brand, data=sawData,
contrasts=list(Brand=contrast.mat))
Contrasts Estimation Power 7 / 18
Contrasts
Fit the model with contrasts
aov.out <- aov(y ~ Brand, data=sawData,
contrasts=list(Brand=contrast.mat))
Now “split” apart the sum-of-squares
summary(aov.out, split = list(Brand =
list("ADvBC"=1, "AvD"=2, "BvC"=3)))
## Df Sum Sq Mean Sq F value Pr(>F)
## Brand 3 1080 360.0 3.556 0.03823 *
## Brand: ADvBC 1 980 980.0 9.679 0.00672 **
## Brand: AvD 1 10 10.0 0.099 0.75738
## Brand: BvC 1 90 90.0 0.889 0.35980
## Residuals 16 1620 101.2
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Contrasts Estimation Power 7 / 18
Difference in means for each contrast
Group means
(group.means <- tapply(sawData$y, sawData$Brand, mean))
## A B C D
## 33 43 49 31
Contrasts Estimation Power 8 / 18
Difference in means for each contrast
Group means
(group.means <- tapply(sawData$y, sawData$Brand, mean))
## A B C D
## 33 43 49 31
Difference in means for A vs D
group.means <- unname(group.means) # Drop names (optional)
group.means[1] - group.means[4]
## [1] 2
Contrasts Estimation Power 8 / 18
Difference in means for each contrast
Group means
(group.means <- tapply(sawData$y, sawData$Brand, mean))
## A B C D
## 33 43 49 31
Difference in means for A vs D
group.means <- unname(group.means) # Drop names (optional)
group.means[1] - group.means[4]
## [1] 2
Difference in means for B vs C
group.means[2] - group.means[3]
## [1] -6
Contrasts Estimation Power 8 / 18
Difference in means for each contrast
Group means
(group.means <- tapply(sawData$y, sawData$Brand, mean))
## A B C D
## 33 43 49 31
Difference in means for A vs D
group.means <- unname(group.means) # Drop names (optional)
group.means[1] - group.means[4]
## [1] 2
Difference in means for B vs C
group.means[2] - group.means[3]
## [1] -6
Difference in means for AD vs BC
mean(group.means[c(1,4)]) - mean(group.means[2:3])
## [1] -14
Contrasts Estimation Power 8 / 18
Standard errors for each contrast
SE for A vs D
se.contrast(aov.out, list(sawData$Brand=="A",
sawData$Brand=="D"))
## [1] 6.363961
Contrasts Estimation Power 9 / 18
Standard errors for each contrast
SE for A vs D
se.contrast(aov.out, list(sawData$Brand=="A",
sawData$Brand=="D"))
## [1] 6.363961
SE for B vs C
se.contrast(aov.out, list(sawData$Brand=="B",
sawData$Brand=="C"))
## [1] 6.363961
Contrasts Estimation Power 9 / 18
Standard errors for each contrast
SE for A vs D
se.contrast(aov.out, list(sawData$Brand=="A",
sawData$Brand=="D"))
## [1] 6.363961
SE for B vs C
se.contrast(aov.out, list(sawData$Brand=="B",
sawData$Brand=="C"))
## [1] 6.363961
SE for AD vs BC
se.contrast(aov.out, list(sawData$Brand=="A" |
sawData$Brand=="D",
sawData$Brand=="B" |
sawData$Brand=="C"))
## [1] 4.5
Contrasts Estimation Power 9 / 18
Today’s Topics
1 Contrasts
2 Estimation
3 Power
Estimating confidence intervals
In an ANOVA context, confidence intervals can be constructed
using the equation:
CI = Point estimate ± tα/2,a(n−1) × SE
As usual, the hard part is computing the SE1
1
See page 300 of Dowdy et al. for SE formulas
Contrasts Estimation Power 11 / 18
Confidence intervals from one-way ANOVA
SE’s for the effect sizes (α’s)
effects.SE <- model.tables(aov.out, type="effects",
se=TRUE)
effects.SE
## Tables of effects
##
## Brand
## Brand
## A B C D
## -6 4 10 -8
##
## Standard errors of effects
## Brand
## 4.5
## replic. 5
Contrasts Estimation Power 12 / 18
Confidence intervals from one-way ANOVA
Extract the α’s and the SEs
# str(effects.SE)
alpha.i <- as.numeric(effects.SE$tables$Brand)
SE <- as.numeric(effects.SE$se)
Contrasts Estimation Power 13 / 18
Confidence intervals from one-way ANOVA
Extract the α’s and the SEs
# str(effects.SE)
alpha.i <- as.numeric(effects.SE$tables$Brand)
SE <- as.numeric(effects.SE$se)
Compute confidence intervals
tc <- qt(0.975, 4*(5-1))
lowerCI <- alpha.i - tc * SE
upperCI <- alpha.i + tc * SE
Contrasts Estimation Power 13 / 18
Confidence intervals from one-way ANOVA
Extract the α’s and the SEs
# str(effects.SE)
alpha.i <- as.numeric(effects.SE$tables$Brand)
SE <- as.numeric(effects.SE$se)
Compute confidence intervals
tc <- qt(0.975, 4*(5-1))
lowerCI <- alpha.i - tc * SE
upperCI <- alpha.i + tc * SE
Put results into a data.frame
CI <- data.frame(effect.size=alpha.i, SE,
lowerCI, upperCI)
round(CI, 2)
## effect.size SE lowerCI upperCI
## 1 -6 4.5 -15.54 3.54
## 2 4 4.5 -5.54 13.54
## 3 10 4.5 0.46 19.54
## 4 -8 4.5 -17.54 1.54
Contrasts Estimation Power 13 / 18
Plot effects and CIs
plot(1:4, CI$effect.size, xlim=c(0.5, 4.5), ylim=c(-18, 20), xaxt="n",
xlab="Brand", ylab="Difference from grand mean", pch=16, cex.lab=1.5)
axis(1, at=1:4, labels=c("A", "B", "C", "D"))
abline(h=0, lty=3)
arrows(1:4, CI$lowerCI, 1:4, CI$upperCI, code=3, angle=90, length=0.05)
q
q
q
q
−1001020
Brand
Differencefromgrandmean
A B C D
Contrasts Estimation Power 14 / 18
Today’s Topics
1 Contrasts
2 Estimation
3 Power
Power analysis for a 2-sample t-test
power.t.test(n=NULL, delta=3, sd=2, sig.level=0.05,
power=0.8)
##
## Two-sample t test power calculation
##
## n = 8.06031
## delta = 3
## sd = 2
## sig.level = 0.05
## power = 0.8
## alternative = two.sided
##
## NOTE: n is number in *each* group
Contrasts Estimation Power 16 / 18
Power analysis for one-way ANOVA
power.anova.test(groups=4, n=5, between.var=360.0,
within.var=101.2, power=NULL)
##
## Balanced one-way analysis of variance power calculation
##
## groups = 4
## n = 5
## between.var = 360
## within.var = 101.2
## sig.level = 0.05
## power = 0.9999359
##
## NOTE: n is number in each group
Contrasts Estimation Power 17 / 18
Assignment
Researchers wish to know if food supplementation affects the growth of
nestling Canada warblers. The treatment groups are: (A) No supplementation
control, (B) low, (C) medium, (D) high, and (E) very high. The response
variable is the weight of a 10 day old nestling.
(1) The researchers are interested in the following contrasts. Are they
orthogonal?
Groups A,B vs C,D,E
Groups A vs B
Groups C vs D,E
Groups D vs E
Contrasts Estimation Power 18 / 18
Assignment
Researchers wish to know if food supplementation affects the growth of
nestling Canada warblers. The treatment groups are: (A) No supplementation
control, (B) low, (C) medium, (D) high, and (E) very high. The response
variable is the weight of a 10 day old nestling.
(1) The researchers are interested in the following contrasts. Are they
orthogonal?
Groups A,B vs C,D,E
Groups A vs B
Groups C vs D,E
Groups D vs E
(2) Using the warblerWeight data, test the null hypothesis of each contrast
by constructing an ANOVA table in R.
Contrasts Estimation Power 18 / 18
Assignment
Researchers wish to know if food supplementation affects the growth of
nestling Canada warblers. The treatment groups are: (A) No supplementation
control, (B) low, (C) medium, (D) high, and (E) very high. The response
variable is the weight of a 10 day old nestling.
(1) The researchers are interested in the following contrasts. Are they
orthogonal?
Groups A,B vs C,D,E
Groups A vs B
Groups C vs D,E
Groups D vs E
(2) Using the warblerWeight data, test the null hypothesis of each contrast
by constructing an ANOVA table in R.
(3) For each contrast:
Compute the difference in the means
The SE of the difference in means
The 95% CI for the difference in means
Contrasts Estimation Power 18 / 18
Assignment
Researchers wish to know if food supplementation affects the growth of
nestling Canada warblers. The treatment groups are: (A) No supplementation
control, (B) low, (C) medium, (D) high, and (E) very high. The response
variable is the weight of a 10 day old nestling.
(1) The researchers are interested in the following contrasts. Are they
orthogonal?
Groups A,B vs C,D,E
Groups A vs B
Groups C vs D,E
Groups D vs E
(2) Using the warblerWeight data, test the null hypothesis of each contrast
by constructing an ANOVA table in R.
(3) For each contrast:
Compute the difference in the means
The SE of the difference in means
The 95% CI for the difference in means
(4) Suppose you wanted to replicate the study with a smaller sample size of
n = 2 per treatment group? What would be your power?
Contrasts Estimation Power 18 / 18
Assignment
Researchers wish to know if food supplementation affects the growth of
nestling Canada warblers. The treatment groups are: (A) No supplementation
control, (B) low, (C) medium, (D) high, and (E) very high. The response
variable is the weight of a 10 day old nestling.
(1) The researchers are interested in the following contrasts. Are they
orthogonal?
Groups A,B vs C,D,E
Groups A vs B
Groups C vs D,E
Groups D vs E
(2) Using the warblerWeight data, test the null hypothesis of each contrast
by constructing an ANOVA table in R.
(3) For each contrast:
Compute the difference in the means
The SE of the difference in means
The 95% CI for the difference in means
(4) Suppose you wanted to replicate the study with a smaller sample size of
n = 2 per treatment group? What would be your power?
Submit your answers in a self-contained script before the next lab.
Contrasts Estimation Power 18 / 18

More Related Content

Similar to Lab 4 - Contrasts, Estimation, and Power Analysis

Course Project for Coursera Practical Machine Learning
Course Project for Coursera Practical Machine LearningCourse Project for Coursera Practical Machine Learning
Course Project for Coursera Practical Machine LearningJohn Edward Slough II
 
Logistic Regression in Case-Control Study
Logistic Regression in Case-Control StudyLogistic Regression in Case-Control Study
Logistic Regression in Case-Control StudySatish Gupta
 
Methods of Unsupervised Learning (Article 10 - Practical Exercises)
Methods of Unsupervised Learning (Article 10 - Practical Exercises)Methods of Unsupervised Learning (Article 10 - Practical Exercises)
Methods of Unsupervised Learning (Article 10 - Practical Exercises)Theodore Grammatikopoulos
 
Regression and Classification with R
Regression and Classification with RRegression and Classification with R
Regression and Classification with RYanchang Zhao
 
Social choice Condorcet paradox
Social choice Condorcet paradox   Social choice Condorcet paradox
Social choice Condorcet paradox Mohammed Hilal
 
RDataMining slides-regression-classification
RDataMining slides-regression-classificationRDataMining slides-regression-classification
RDataMining slides-regression-classificationYanchang Zhao
 
Machine Learning Foundations Project Presentation
Machine Learning Foundations Project PresentationMachine Learning Foundations Project Presentation
Machine Learning Foundations Project PresentationAmit J Bhattacharyya
 
BU7261 Bipolar Op-Amps using SPICE
BU7261 Bipolar Op-Amps using SPICEBU7261 Bipolar Op-Amps using SPICE
BU7261 Bipolar Op-Amps using SPICETsuyoshi Horigome
 
Digital electronics k map comparators and their function
Digital electronics k map comparators and their functionDigital electronics k map comparators and their function
Digital electronics k map comparators and their functionkumarankit06875
 
Time Series Analysis on Egg depositions (in millions) of age-3 Lake Huron Blo...
Time Series Analysis on Egg depositions (in millions) of age-3 Lake Huron Blo...Time Series Analysis on Egg depositions (in millions) of age-3 Lake Huron Blo...
Time Series Analysis on Egg depositions (in millions) of age-3 Lake Huron Blo...ShuaiGao3
 
Question 2 of 231.0 PointsA company operates four machines dur.docx
Question 2 of 231.0 PointsA company operates four machines dur.docxQuestion 2 of 231.0 PointsA company operates four machines dur.docx
Question 2 of 231.0 PointsA company operates four machines dur.docxwraythallchan
 
267 4 determinant and cross product-n
267 4 determinant and cross product-n267 4 determinant and cross product-n
267 4 determinant and cross product-nmath260
 

Similar to Lab 4 - Contrasts, Estimation, and Power Analysis (20)

Course Project for Coursera Practical Machine Learning
Course Project for Coursera Practical Machine LearningCourse Project for Coursera Practical Machine Learning
Course Project for Coursera Practical Machine Learning
 
Logistic Regression in Case-Control Study
Logistic Regression in Case-Control StudyLogistic Regression in Case-Control Study
Logistic Regression in Case-Control Study
 
Methods of Unsupervised Learning (Article 10 - Practical Exercises)
Methods of Unsupervised Learning (Article 10 - Practical Exercises)Methods of Unsupervised Learning (Article 10 - Practical Exercises)
Methods of Unsupervised Learning (Article 10 - Practical Exercises)
 
Regression and Classification with R
Regression and Classification with RRegression and Classification with R
Regression and Classification with R
 
Social choice Condorcet paradox
Social choice Condorcet paradox   Social choice Condorcet paradox
Social choice Condorcet paradox
 
RDataMining slides-regression-classification
RDataMining slides-regression-classificationRDataMining slides-regression-classification
RDataMining slides-regression-classification
 
Machine Learning Foundations Project Presentation
Machine Learning Foundations Project PresentationMachine Learning Foundations Project Presentation
Machine Learning Foundations Project Presentation
 
Iowa_Report_2
Iowa_Report_2Iowa_Report_2
Iowa_Report_2
 
BTS5016-1EKB SPICE Model
BTS5016-1EKB SPICE ModelBTS5016-1EKB SPICE Model
BTS5016-1EKB SPICE Model
 
BU7261 Bipolar Op-Amps using SPICE
BU7261 Bipolar Op-Amps using SPICEBU7261 Bipolar Op-Amps using SPICE
BU7261 Bipolar Op-Amps using SPICE
 
Computer Science Assignment Help
Computer Science Assignment Help Computer Science Assignment Help
Computer Science Assignment Help
 
FINAL_TAKE_HOME
FINAL_TAKE_HOMEFINAL_TAKE_HOME
FINAL_TAKE_HOME
 
Digital electronics k map comparators and their function
Digital electronics k map comparators and their functionDigital electronics k map comparators and their function
Digital electronics k map comparators and their function
 
Time Series Analysis on Egg depositions (in millions) of age-3 Lake Huron Blo...
Time Series Analysis on Egg depositions (in millions) of age-3 Lake Huron Blo...Time Series Analysis on Egg depositions (in millions) of age-3 Lake Huron Blo...
Time Series Analysis on Egg depositions (in millions) of age-3 Lake Huron Blo...
 
DM 3.pdf
DM 3.pdfDM 3.pdf
DM 3.pdf
 
PCA and SVD in brief
PCA and SVD in briefPCA and SVD in brief
PCA and SVD in brief
 
Question 2 of 231.0 PointsA company operates four machines dur.docx
Question 2 of 231.0 PointsA company operates four machines dur.docxQuestion 2 of 231.0 PointsA company operates four machines dur.docx
Question 2 of 231.0 PointsA company operates four machines dur.docx
 
267 4 determinant and cross product-n
267 4 determinant and cross product-n267 4 determinant and cross product-n
267 4 determinant and cross product-n
 
QUARTILE DEVIATION
QUARTILE DEVIATIONQUARTILE DEVIATION
QUARTILE DEVIATION
 
Basic R
Basic RBasic R
Basic R
 

More from richardchandler

Model Selection and Multi-model Inference
Model Selection and Multi-model InferenceModel Selection and Multi-model Inference
Model Selection and Multi-model Inferencerichardchandler
 
Introduction to Generalized Linear Models
Introduction to Generalized Linear ModelsIntroduction to Generalized Linear Models
Introduction to Generalized Linear Modelsrichardchandler
 
Introduction to statistical modeling in R
Introduction to statistical modeling in RIntroduction to statistical modeling in R
Introduction to statistical modeling in Rrichardchandler
 
t-tests in R - Lab slides for UGA course FANR 6750
t-tests in R - Lab slides for UGA course FANR 6750t-tests in R - Lab slides for UGA course FANR 6750
t-tests in R - Lab slides for UGA course FANR 6750richardchandler
 
Introduction to R - Lab slides for UGA course FANR 6750
Introduction to R - Lab slides for UGA course FANR 6750Introduction to R - Lab slides for UGA course FANR 6750
Introduction to R - Lab slides for UGA course FANR 6750richardchandler
 
Hierarchichal species distributions model and Maxent
Hierarchichal species distributions model and MaxentHierarchichal species distributions model and Maxent
Hierarchichal species distributions model and Maxentrichardchandler
 
The role of spatial models in applied ecological research
The role of spatial models in applied ecological researchThe role of spatial models in applied ecological research
The role of spatial models in applied ecological researchrichardchandler
 

More from richardchandler (14)

Model Selection and Multi-model Inference
Model Selection and Multi-model InferenceModel Selection and Multi-model Inference
Model Selection and Multi-model Inference
 
Introduction to Generalized Linear Models
Introduction to Generalized Linear ModelsIntroduction to Generalized Linear Models
Introduction to Generalized Linear Models
 
Introduction to statistical modeling in R
Introduction to statistical modeling in RIntroduction to statistical modeling in R
Introduction to statistical modeling in R
 
Split-plot Designs
Split-plot DesignsSplit-plot Designs
Split-plot Designs
 
Nested Designs
Nested DesignsNested Designs
Nested Designs
 
Factorial designs
Factorial designsFactorial designs
Factorial designs
 
Blocking lab
Blocking labBlocking lab
Blocking lab
 
Assumptions of ANOVA
Assumptions of ANOVAAssumptions of ANOVA
Assumptions of ANOVA
 
t-tests in R - Lab slides for UGA course FANR 6750
t-tests in R - Lab slides for UGA course FANR 6750t-tests in R - Lab slides for UGA course FANR 6750
t-tests in R - Lab slides for UGA course FANR 6750
 
Introduction to R - Lab slides for UGA course FANR 6750
Introduction to R - Lab slides for UGA course FANR 6750Introduction to R - Lab slides for UGA course FANR 6750
Introduction to R - Lab slides for UGA course FANR 6750
 
Hierarchichal species distributions model and Maxent
Hierarchichal species distributions model and MaxentHierarchichal species distributions model and Maxent
Hierarchichal species distributions model and Maxent
 
Slides from ESA 2015
Slides from ESA 2015Slides from ESA 2015
Slides from ESA 2015
 
The role of spatial models in applied ecological research
The role of spatial models in applied ecological researchThe role of spatial models in applied ecological research
The role of spatial models in applied ecological research
 
2014 ISEC slides
2014 ISEC slides2014 ISEC slides
2014 ISEC slides
 

Recently uploaded

Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Sérgio Sacani
 
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tantaDashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tantaPraksha3
 
Animal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxAnimal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxUmerFayaz5
 
Analytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdfAnalytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdfSwapnil Therkar
 
Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Nistarini College, Purulia (W.B) India
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real timeSatoshi NAKAHIRA
 
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.PraveenaKalaiselvan1
 
Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Patrick Diehl
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxSwapnil Therkar
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )aarthirajkumar25
 
Recombinant DNA technology( Transgenic plant and animal)
Recombinant DNA technology( Transgenic plant and animal)Recombinant DNA technology( Transgenic plant and animal)
Recombinant DNA technology( Transgenic plant and animal)DHURKADEVIBASKAR
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PPRINCE C P
 
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...Sérgio Sacani
 
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsHubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsSérgio Sacani
 
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptxUnlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptxanandsmhk
 
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfBehavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfSELF-EXPLANATORY
 
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCESTERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCEPRINCE C P
 
Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...RohitNehra6
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 

Recently uploaded (20)

Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
 
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tantaDashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
 
Animal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxAnimal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptx
 
Analytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdfAnalytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdf
 
Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real time
 
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
 
The Philosophy of Science
The Philosophy of ScienceThe Philosophy of Science
The Philosophy of Science
 
Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )
 
Recombinant DNA technology( Transgenic plant and animal)
Recombinant DNA technology( Transgenic plant and animal)Recombinant DNA technology( Transgenic plant and animal)
Recombinant DNA technology( Transgenic plant and animal)
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C P
 
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
 
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsHubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
 
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptxUnlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
 
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfBehavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
 
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCESTERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
 
Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 

Lab 4 - Contrasts, Estimation, and Power Analysis

  • 1. Lab 4 – Contrasts, Estimation, and Power Analysis September 10 & 11, 2018 FANR 6750 Richard Chandler and Bob Cooper University of Georgia
  • 2. Today’s Topics 1 Contrasts 2 Estimation 3 Power
  • 3. Today’s Topics 1 Contrasts 2 Estimation 3 Power
  • 4. Chain Saw Data sawData <- read.csv("sawData.csv") sawData ## y Brand ## 1 42 A ## 2 17 A ## 3 24 A ## 4 39 A ## 5 43 A ## 6 28 B ## 7 50 B ## 8 44 B ## 9 32 B ## 10 61 B ## 11 57 C ## 12 45 C ## 13 48 C ## 14 41 C ## 15 54 C ## 16 29 D ## 17 40 D ## 18 22 D ## 19 34 D ## 20 30 D Contrasts Estimation Power 3 / 18
  • 5. Contrasts Suppose we want to make 3 a priori comparisons: (1) Groups A&D vs B&C (2) Groups A vs D (3) Groups B vs C Contrasts Estimation Power 4 / 18
  • 6. Contrasts Suppose we want to make 3 a priori comparisons: (1) Groups A&D vs B&C (2) Groups A vs D (3) Groups B vs C Comparison Null hypothesis 1 AD vs BC µA+µD 2 − µB+µC 2 = 0 2 A vs D µA − µD = 0 3 B vs C µB − µC = 0 Contrasts Estimation Power 4 / 18
  • 7. Constructing contrasts in R Coefficients ADvBC <- c(1/2, -1/2, -1/2, 1/2) AvD <- c(1, 0, 0, -1) BvC <- c(0, 1, -1, 0) Contrasts Estimation Power 5 / 18
  • 8. Constructing contrasts in R Coefficients ADvBC <- c(1/2, -1/2, -1/2, 1/2) AvD <- c(1, 0, 0, -1) BvC <- c(0, 1, -1, 0) Are they orthogonal? Contrasts Estimation Power 5 / 18
  • 9. Constructing contrasts in R Coefficients ADvBC <- c(1/2, -1/2, -1/2, 1/2) AvD <- c(1, 0, 0, -1) BvC <- c(0, 1, -1, 0) Are they orthogonal? sum(ADvBC) ## [1] 0 sum(AvD) ## [1] 0 sum(BvC) ## [1] 0 Contrasts Estimation Power 5 / 18
  • 10. Constructing contrasts in R Coefficients ADvBC <- c(1/2, -1/2, -1/2, 1/2) AvD <- c(1, 0, 0, -1) BvC <- c(0, 1, -1, 0) Are they orthogonal? sum(ADvBC) ## [1] 0 sum(AvD) ## [1] 0 sum(BvC) ## [1] 0 sum(ADvBC * AvD) ## [1] 0 sum(ADvBC * BvC) ## [1] 0 sum(AvD * BvC) ## [1] 0 Contrasts Estimation Power 5 / 18
  • 11. Constructing contrasts in R Coefficients ADvBC <- c(1/2, -1/2, -1/2, 1/2) AvD <- c(1, 0, 0, -1) BvC <- c(0, 1, -1, 0) Are they orthogonal? sum(ADvBC) ## [1] 0 sum(AvD) ## [1] 0 sum(BvC) ## [1] 0 sum(ADvBC * AvD) ## [1] 0 sum(ADvBC * BvC) ## [1] 0 sum(AvD * BvC) ## [1] 0 Yes, they are. Contrasts Estimation Power 5 / 18
  • 12. We need to put the contrasts into a matrix To use contrasts in R, each set of coefficients must be formatted as a column in a matrix. Contrasts Estimation Power 6 / 18
  • 13. We need to put the contrasts into a matrix To use contrasts in R, each set of coefficients must be formatted as a column in a matrix. We can use cbind for this: contrast.mat <- cbind(ADvBC, AvD, BvC) contrast.mat ## ADvBC AvD BvC ## [1,] 0.5 1 0 ## [2,] -0.5 0 1 ## [3,] -0.5 0 -1 ## [4,] 0.5 -1 0 Contrasts Estimation Power 6 / 18
  • 14. Contrasts Fit the model with contrasts aov.out <- aov(y ~ Brand, data=sawData, contrasts=list(Brand=contrast.mat)) Contrasts Estimation Power 7 / 18
  • 15. Contrasts Fit the model with contrasts aov.out <- aov(y ~ Brand, data=sawData, contrasts=list(Brand=contrast.mat)) Now “split” apart the sum-of-squares summary(aov.out, split = list(Brand = list("ADvBC"=1, "AvD"=2, "BvC"=3))) ## Df Sum Sq Mean Sq F value Pr(>F) ## Brand 3 1080 360.0 3.556 0.03823 * ## Brand: ADvBC 1 980 980.0 9.679 0.00672 ** ## Brand: AvD 1 10 10.0 0.099 0.75738 ## Brand: BvC 1 90 90.0 0.889 0.35980 ## Residuals 16 1620 101.2 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Contrasts Estimation Power 7 / 18
  • 16. Difference in means for each contrast Group means (group.means <- tapply(sawData$y, sawData$Brand, mean)) ## A B C D ## 33 43 49 31 Contrasts Estimation Power 8 / 18
  • 17. Difference in means for each contrast Group means (group.means <- tapply(sawData$y, sawData$Brand, mean)) ## A B C D ## 33 43 49 31 Difference in means for A vs D group.means <- unname(group.means) # Drop names (optional) group.means[1] - group.means[4] ## [1] 2 Contrasts Estimation Power 8 / 18
  • 18. Difference in means for each contrast Group means (group.means <- tapply(sawData$y, sawData$Brand, mean)) ## A B C D ## 33 43 49 31 Difference in means for A vs D group.means <- unname(group.means) # Drop names (optional) group.means[1] - group.means[4] ## [1] 2 Difference in means for B vs C group.means[2] - group.means[3] ## [1] -6 Contrasts Estimation Power 8 / 18
  • 19. Difference in means for each contrast Group means (group.means <- tapply(sawData$y, sawData$Brand, mean)) ## A B C D ## 33 43 49 31 Difference in means for A vs D group.means <- unname(group.means) # Drop names (optional) group.means[1] - group.means[4] ## [1] 2 Difference in means for B vs C group.means[2] - group.means[3] ## [1] -6 Difference in means for AD vs BC mean(group.means[c(1,4)]) - mean(group.means[2:3]) ## [1] -14 Contrasts Estimation Power 8 / 18
  • 20. Standard errors for each contrast SE for A vs D se.contrast(aov.out, list(sawData$Brand=="A", sawData$Brand=="D")) ## [1] 6.363961 Contrasts Estimation Power 9 / 18
  • 21. Standard errors for each contrast SE for A vs D se.contrast(aov.out, list(sawData$Brand=="A", sawData$Brand=="D")) ## [1] 6.363961 SE for B vs C se.contrast(aov.out, list(sawData$Brand=="B", sawData$Brand=="C")) ## [1] 6.363961 Contrasts Estimation Power 9 / 18
  • 22. Standard errors for each contrast SE for A vs D se.contrast(aov.out, list(sawData$Brand=="A", sawData$Brand=="D")) ## [1] 6.363961 SE for B vs C se.contrast(aov.out, list(sawData$Brand=="B", sawData$Brand=="C")) ## [1] 6.363961 SE for AD vs BC se.contrast(aov.out, list(sawData$Brand=="A" | sawData$Brand=="D", sawData$Brand=="B" | sawData$Brand=="C")) ## [1] 4.5 Contrasts Estimation Power 9 / 18
  • 23. Today’s Topics 1 Contrasts 2 Estimation 3 Power
  • 24. Estimating confidence intervals In an ANOVA context, confidence intervals can be constructed using the equation: CI = Point estimate ± tα/2,a(n−1) × SE As usual, the hard part is computing the SE1 1 See page 300 of Dowdy et al. for SE formulas Contrasts Estimation Power 11 / 18
  • 25. Confidence intervals from one-way ANOVA SE’s for the effect sizes (α’s) effects.SE <- model.tables(aov.out, type="effects", se=TRUE) effects.SE ## Tables of effects ## ## Brand ## Brand ## A B C D ## -6 4 10 -8 ## ## Standard errors of effects ## Brand ## 4.5 ## replic. 5 Contrasts Estimation Power 12 / 18
  • 26. Confidence intervals from one-way ANOVA Extract the α’s and the SEs # str(effects.SE) alpha.i <- as.numeric(effects.SE$tables$Brand) SE <- as.numeric(effects.SE$se) Contrasts Estimation Power 13 / 18
  • 27. Confidence intervals from one-way ANOVA Extract the α’s and the SEs # str(effects.SE) alpha.i <- as.numeric(effects.SE$tables$Brand) SE <- as.numeric(effects.SE$se) Compute confidence intervals tc <- qt(0.975, 4*(5-1)) lowerCI <- alpha.i - tc * SE upperCI <- alpha.i + tc * SE Contrasts Estimation Power 13 / 18
  • 28. Confidence intervals from one-way ANOVA Extract the α’s and the SEs # str(effects.SE) alpha.i <- as.numeric(effects.SE$tables$Brand) SE <- as.numeric(effects.SE$se) Compute confidence intervals tc <- qt(0.975, 4*(5-1)) lowerCI <- alpha.i - tc * SE upperCI <- alpha.i + tc * SE Put results into a data.frame CI <- data.frame(effect.size=alpha.i, SE, lowerCI, upperCI) round(CI, 2) ## effect.size SE lowerCI upperCI ## 1 -6 4.5 -15.54 3.54 ## 2 4 4.5 -5.54 13.54 ## 3 10 4.5 0.46 19.54 ## 4 -8 4.5 -17.54 1.54 Contrasts Estimation Power 13 / 18
  • 29. Plot effects and CIs plot(1:4, CI$effect.size, xlim=c(0.5, 4.5), ylim=c(-18, 20), xaxt="n", xlab="Brand", ylab="Difference from grand mean", pch=16, cex.lab=1.5) axis(1, at=1:4, labels=c("A", "B", "C", "D")) abline(h=0, lty=3) arrows(1:4, CI$lowerCI, 1:4, CI$upperCI, code=3, angle=90, length=0.05) q q q q −1001020 Brand Differencefromgrandmean A B C D Contrasts Estimation Power 14 / 18
  • 30. Today’s Topics 1 Contrasts 2 Estimation 3 Power
  • 31. Power analysis for a 2-sample t-test power.t.test(n=NULL, delta=3, sd=2, sig.level=0.05, power=0.8) ## ## Two-sample t test power calculation ## ## n = 8.06031 ## delta = 3 ## sd = 2 ## sig.level = 0.05 ## power = 0.8 ## alternative = two.sided ## ## NOTE: n is number in *each* group Contrasts Estimation Power 16 / 18
  • 32. Power analysis for one-way ANOVA power.anova.test(groups=4, n=5, between.var=360.0, within.var=101.2, power=NULL) ## ## Balanced one-way analysis of variance power calculation ## ## groups = 4 ## n = 5 ## between.var = 360 ## within.var = 101.2 ## sig.level = 0.05 ## power = 0.9999359 ## ## NOTE: n is number in each group Contrasts Estimation Power 17 / 18
  • 33. Assignment Researchers wish to know if food supplementation affects the growth of nestling Canada warblers. The treatment groups are: (A) No supplementation control, (B) low, (C) medium, (D) high, and (E) very high. The response variable is the weight of a 10 day old nestling. (1) The researchers are interested in the following contrasts. Are they orthogonal? Groups A,B vs C,D,E Groups A vs B Groups C vs D,E Groups D vs E Contrasts Estimation Power 18 / 18
  • 34. Assignment Researchers wish to know if food supplementation affects the growth of nestling Canada warblers. The treatment groups are: (A) No supplementation control, (B) low, (C) medium, (D) high, and (E) very high. The response variable is the weight of a 10 day old nestling. (1) The researchers are interested in the following contrasts. Are they orthogonal? Groups A,B vs C,D,E Groups A vs B Groups C vs D,E Groups D vs E (2) Using the warblerWeight data, test the null hypothesis of each contrast by constructing an ANOVA table in R. Contrasts Estimation Power 18 / 18
  • 35. Assignment Researchers wish to know if food supplementation affects the growth of nestling Canada warblers. The treatment groups are: (A) No supplementation control, (B) low, (C) medium, (D) high, and (E) very high. The response variable is the weight of a 10 day old nestling. (1) The researchers are interested in the following contrasts. Are they orthogonal? Groups A,B vs C,D,E Groups A vs B Groups C vs D,E Groups D vs E (2) Using the warblerWeight data, test the null hypothesis of each contrast by constructing an ANOVA table in R. (3) For each contrast: Compute the difference in the means The SE of the difference in means The 95% CI for the difference in means Contrasts Estimation Power 18 / 18
  • 36. Assignment Researchers wish to know if food supplementation affects the growth of nestling Canada warblers. The treatment groups are: (A) No supplementation control, (B) low, (C) medium, (D) high, and (E) very high. The response variable is the weight of a 10 day old nestling. (1) The researchers are interested in the following contrasts. Are they orthogonal? Groups A,B vs C,D,E Groups A vs B Groups C vs D,E Groups D vs E (2) Using the warblerWeight data, test the null hypothesis of each contrast by constructing an ANOVA table in R. (3) For each contrast: Compute the difference in the means The SE of the difference in means The 95% CI for the difference in means (4) Suppose you wanted to replicate the study with a smaller sample size of n = 2 per treatment group? What would be your power? Contrasts Estimation Power 18 / 18
  • 37. Assignment Researchers wish to know if food supplementation affects the growth of nestling Canada warblers. The treatment groups are: (A) No supplementation control, (B) low, (C) medium, (D) high, and (E) very high. The response variable is the weight of a 10 day old nestling. (1) The researchers are interested in the following contrasts. Are they orthogonal? Groups A,B vs C,D,E Groups A vs B Groups C vs D,E Groups D vs E (2) Using the warblerWeight data, test the null hypothesis of each contrast by constructing an ANOVA table in R. (3) For each contrast: Compute the difference in the means The SE of the difference in means The 95% CI for the difference in means (4) Suppose you wanted to replicate the study with a smaller sample size of n = 2 per treatment group? What would be your power? Submit your answers in a self-contained script before the next lab. Contrasts Estimation Power 18 / 18