SlideShare a Scribd company logo
1 of 22
Download to read offline
Analysis of Covariance
David Markham
djmarkham@bsu.edu
Analysis of Covariance
 Analysis of Covariance (ANCOVA) is a
statistical test related to ANOVA
 It tests whether there is a significant
difference between groups after controlling
for variance explained by a covariate
 A covariate is a continuous variable that
correlates with the dependent variable
So, what does all that mean?
 This means that you can, in effect, “partial
out” a continuous variable and run an
ANOVA on the results
 This is one way that you can run a
statistical test with both categorical and
continuous independent variables
Hypotheses for ANCOVA
 H0 and H1 need to be stated slightly
differently for an ANCOVA than a regular
ANOVA
 H0: the group means are equal after
controlling for the covariate
 H1: the group means are not equal after
controlling for the covariate
Assumptions for ANCOVA
ANOVA assumptions:
 Variance is normally distributed
 Variance is equal between groups
 All measurements are independent
Also, for ANCOVA:
 Relationship between DV and covariate is
linear
 The relationship between the DV and
covariate is the same for all groups
How does ANCOVA work?
 ANCOVA works by adjusting the total SS,
group SS, and error SS of the independent
variable to remove the influence of the
covariate
 However, the sums of squares must also
be calculated for the covariate. For this
reason, SSdv will be used for SS scores for
the dependent variable, and SScv will be
used for the covariate
Sum of Squares
groupSStotalSSerrorSS
xxerrorSS
xxngroupSS
xxtotalSS
xxx
jijx
jjx
ijx







2
2
2
)(
)(
)(
Sum of Products
 To control for the covariate, the sum of products
(SP) for the DV and covariate must also be
used
 This is the sum of the products of the residuals
for both the DV and the covariate
 In the following slides, x is the covariate, and y
is the DV. i is the individual subject, and j is the
group.
Total Sum of Products
))(( yyxxtotalSP ij
j i
ijxy 

 This is just the sum of the multiplied residuals
for all data points.
Group Sum of Products
)()( yyxxngroupSP j
j
jjxy 

 This is the sum of the products of the group
means minus the grand means times the group
size.
Error Sum of Products
groupSPtotalSPerrorSP
yyxxerrorSP
xyxyxy
jij
j i
jijxy


 ))((
 This is the sum of the products of the DV and
residual minus the group means of the DV and
residual
 This just happens to be the same as the difference
between the other two sum of products
Adjusting the Sum of Squares
 Using the SS’s for the covariate and the
DV, and the SP’s, we can adjust the SS’s
for the DV
Sum of Squares
 
   
errorSS
errorSP
errorSSadjerrorSS
totalSS
totalSP
errorSS
errorSP
groupSSadjgroupSS
totalSS
totalSP
totalSSadjtotalSS
x
xy
yy
x
xy
x
xy
yy
x
xy
yy
2
22
2
)(



Now what?
 Using the adjusted SS’s, we can now run
an ANOVA to see if there is a difference
between groups.
 This is the exact same as a regular
ANOVA, but using the adjusted SS’s
instead of the original ones.
 Degrees of freedom are not affected
A few more things
 We can also determine whether the
covariate is significant by getting a F score
 
adjtotalSS
N
totalSS
totalSP
NF
y
x
xy
2
)(
)2,1(
2










A few more things
 The group means can also be adjusted to
eliminate the effect of the covariate
 xx
errorSS
errorSP
yyadj j
x
xy
jj









Post-hocs for ANCOVA
 Post-hoc tests can be done using the
adjusted means for ANCOVA, including
LSD and Bonferroni
Example of ANCOVA
 Imagine we gave subjects a self-esteem
test, with scores of 1 to 10
 Then we primed subjects with either
positive or negative emotions.
 Then we asked them to spend a few
minutes writing about themselves.
 Our dependent measure is the number of
positive emotion words they used (e.g.
happy, good)
 The null hypothesis is that the priming
doesn’t make a difference after controlling
for self-esteem
 The alternative hypothesis is that the
priming does make a difference after
controlling for self-esteem
Example of ANCOVA, cont.
Data
Subject # Priming Self-Esteem Positive Words
1 Positive 1 7
2 Positive 5 10
3 Positive 7 11
4 Negative 8 7
5 Negative 3 4
6 Negative 6 5
ANCOVA in SPSS
 To do ANCOVA in SPSS, all you need to
do is add your covariate to the “covariate”
box in the “univariate” menu
 Everything else is the exact same as it is
for ANOVA
Analysis of covariance

More Related Content

What's hot

ANCOVA-Analysis-of-Covariance.pptx
ANCOVA-Analysis-of-Covariance.pptxANCOVA-Analysis-of-Covariance.pptx
ANCOVA-Analysis-of-Covariance.pptxRomielyn Beran
 
descriptive and inferential statistics
descriptive and inferential statisticsdescriptive and inferential statistics
descriptive and inferential statisticsMona Sajid
 
Analysis of variance
Analysis of varianceAnalysis of variance
Analysis of varianceAndi Koentary
 
Parametric vs Nonparametric Tests: When to use which
Parametric vs Nonparametric Tests: When to use whichParametric vs Nonparametric Tests: When to use which
Parametric vs Nonparametric Tests: When to use whichGönenç Dalgıç
 
One way anova final ppt.
One way anova final ppt.One way anova final ppt.
One way anova final ppt.Aadab Mushrib
 
Population vs sample
Population vs samplePopulation vs sample
Population vs sample5829591
 
Parametric tests
Parametric testsParametric tests
Parametric testsheena45
 
non parametric statistics
non parametric statisticsnon parametric statistics
non parametric statisticsAnchal Garg
 
Parametric and nonparametric test
Parametric and nonparametric testParametric and nonparametric test
Parametric and nonparametric testponnienselvi
 
Descriptive statistics
Descriptive statisticsDescriptive statistics
Descriptive statisticsSarfraz Ahmad
 
Anova (f test) and mean differentiation
Anova (f test) and mean differentiationAnova (f test) and mean differentiation
Anova (f test) and mean differentiationSubramani Parasuraman
 
Parametric Statistical tests
Parametric Statistical testsParametric Statistical tests
Parametric Statistical testsSundar B N
 
What is a Kruskal Wallis-Test?
What is a Kruskal Wallis-Test?What is a Kruskal Wallis-Test?
What is a Kruskal Wallis-Test?Ken Plummer
 

What's hot (20)

ANCOVA-Analysis-of-Covariance.pptx
ANCOVA-Analysis-of-Covariance.pptxANCOVA-Analysis-of-Covariance.pptx
ANCOVA-Analysis-of-Covariance.pptx
 
descriptive and inferential statistics
descriptive and inferential statisticsdescriptive and inferential statistics
descriptive and inferential statistics
 
Parametric Test
Parametric TestParametric Test
Parametric Test
 
Analysis of variance
Analysis of varianceAnalysis of variance
Analysis of variance
 
Anova; analysis of variance
Anova; analysis of varianceAnova; analysis of variance
Anova; analysis of variance
 
Parametric vs Nonparametric Tests: When to use which
Parametric vs Nonparametric Tests: When to use whichParametric vs Nonparametric Tests: When to use which
Parametric vs Nonparametric Tests: When to use which
 
Chi squared test
Chi squared testChi squared test
Chi squared test
 
One way anova final ppt.
One way anova final ppt.One way anova final ppt.
One way anova final ppt.
 
Population vs sample
Population vs samplePopulation vs sample
Population vs sample
 
Analysis of variance
Analysis of varianceAnalysis of variance
Analysis of variance
 
Parametric tests
Parametric testsParametric tests
Parametric tests
 
non parametric statistics
non parametric statisticsnon parametric statistics
non parametric statistics
 
Two Way ANOVA
Two Way ANOVATwo Way ANOVA
Two Way ANOVA
 
Parametric and nonparametric test
Parametric and nonparametric testParametric and nonparametric test
Parametric and nonparametric test
 
Chapter 7
Chapter 7Chapter 7
Chapter 7
 
Descriptive statistics
Descriptive statisticsDescriptive statistics
Descriptive statistics
 
Anova (f test) and mean differentiation
Anova (f test) and mean differentiationAnova (f test) and mean differentiation
Anova (f test) and mean differentiation
 
Parametric Statistical tests
Parametric Statistical testsParametric Statistical tests
Parametric Statistical tests
 
What is a Kruskal Wallis-Test?
What is a Kruskal Wallis-Test?What is a Kruskal Wallis-Test?
What is a Kruskal Wallis-Test?
 
Non parametric test
Non parametric testNon parametric test
Non parametric test
 

Viewers also liked (9)

Ch 05
Ch 05Ch 05
Ch 05
 
Arbitrage
ArbitrageArbitrage
Arbitrage
 
Portfolio rebalancing made simple
Portfolio rebalancing made simplePortfolio rebalancing made simple
Portfolio rebalancing made simple
 
Chart patterns
Chart patternsChart patterns
Chart patterns
 
Arbitrage
ArbitrageArbitrage
Arbitrage
 
Resistance To Change
Resistance To ChangeResistance To Change
Resistance To Change
 
Technical Analysis
Technical AnalysisTechnical Analysis
Technical Analysis
 
Portfolio revision
Portfolio revisionPortfolio revision
Portfolio revision
 
Fundamental analysis and technical analysis
Fundamental analysis and technical analysisFundamental analysis and technical analysis
Fundamental analysis and technical analysis
 

Similar to Analysis of covariance

Ashish Dadheech PRESENT TOPIC NURSING RESEARCH
Ashish Dadheech PRESENT TOPIC NURSING RESEARCHAshish Dadheech PRESENT TOPIC NURSING RESEARCH
Ashish Dadheech PRESENT TOPIC NURSING RESEARCHAshish Dadheech
 
Lecture - ANCOVA 4 Slides.pdf
Lecture - ANCOVA 4 Slides.pdfLecture - ANCOVA 4 Slides.pdf
Lecture - ANCOVA 4 Slides.pdfmuhammad shahid
 
8 a class slides one way anova part 1
8 a class slides   one way anova part 18 a class slides   one way anova part 1
8 a class slides one way anova part 1mjb70
 
Variance component analysis by paravayya c pujeri
Variance component analysis by paravayya c pujeriVariance component analysis by paravayya c pujeri
Variance component analysis by paravayya c pujeriParavayya Pujeri
 
Anova lecture
Anova lectureAnova lecture
Anova lecturedoublem44
 
Anova (analysis of variance) test
Anova (analysis of variance) test Anova (analysis of variance) test
Anova (analysis of variance) test Ashwini Mathur
 
One way repeated measure anova
One way repeated measure anovaOne way repeated measure anova
One way repeated measure anovaAamna Haneef
 
Analysis of Variance
Analysis of VarianceAnalysis of Variance
Analysis of VarianceMichael770443
 
ANOVA biostat easy explaination .pptx
ANOVA biostat easy explaination    .pptxANOVA biostat easy explaination    .pptx
ANOVA biostat easy explaination .pptxDrDeveshPandey1
 
Tugasan kumpulan anova
Tugasan kumpulan anovaTugasan kumpulan anova
Tugasan kumpulan anovapraba karan
 
ANOVA (Educational Statistics)
ANOVA (Educational Statistics)ANOVA (Educational Statistics)
ANOVA (Educational Statistics)HennaAnsari
 
Analysis of variance (anova)
Analysis of variance (anova)Analysis of variance (anova)
Analysis of variance (anova)Sadhana Singh
 
Statistics for Anaesthesiologists
Statistics for AnaesthesiologistsStatistics for Anaesthesiologists
Statistics for Anaesthesiologistsxeonfusion
 
Statistical Tools
Statistical ToolsStatistical Tools
Statistical ToolsZyrenMisaki
 
12-5-03.ppt
12-5-03.ppt12-5-03.ppt
12-5-03.pptMUzair21
 
Calculating Analysis of Variance (ANOVA) and Post Hoc Analyses Follo.docx
Calculating Analysis of Variance (ANOVA) and Post Hoc Analyses Follo.docxCalculating Analysis of Variance (ANOVA) and Post Hoc Analyses Follo.docx
Calculating Analysis of Variance (ANOVA) and Post Hoc Analyses Follo.docxaman341480
 

Similar to Analysis of covariance (20)

Ashish Dadheech PRESENT TOPIC NURSING RESEARCH
Ashish Dadheech PRESENT TOPIC NURSING RESEARCHAshish Dadheech PRESENT TOPIC NURSING RESEARCH
Ashish Dadheech PRESENT TOPIC NURSING RESEARCH
 
Split plot anova slide
Split plot anova slideSplit plot anova slide
Split plot anova slide
 
Lecture - ANCOVA 4 Slides.pdf
Lecture - ANCOVA 4 Slides.pdfLecture - ANCOVA 4 Slides.pdf
Lecture - ANCOVA 4 Slides.pdf
 
In Anova
In  AnovaIn  Anova
In Anova
 
8 a class slides one way anova part 1
8 a class slides   one way anova part 18 a class slides   one way anova part 1
8 a class slides one way anova part 1
 
Applied statistics part 3
Applied statistics part 3Applied statistics part 3
Applied statistics part 3
 
Variance component analysis by paravayya c pujeri
Variance component analysis by paravayya c pujeriVariance component analysis by paravayya c pujeri
Variance component analysis by paravayya c pujeri
 
Anova lecture
Anova lectureAnova lecture
Anova lecture
 
Anova (analysis of variance) test
Anova (analysis of variance) test Anova (analysis of variance) test
Anova (analysis of variance) test
 
One way repeated measure anova
One way repeated measure anovaOne way repeated measure anova
One way repeated measure anova
 
Analysis of Variance
Analysis of VarianceAnalysis of Variance
Analysis of Variance
 
ANOVA biostat easy explaination .pptx
ANOVA biostat easy explaination    .pptxANOVA biostat easy explaination    .pptx
ANOVA biostat easy explaination .pptx
 
Tugasan kumpulan anova
Tugasan kumpulan anovaTugasan kumpulan anova
Tugasan kumpulan anova
 
ANOVA (Educational Statistics)
ANOVA (Educational Statistics)ANOVA (Educational Statistics)
ANOVA (Educational Statistics)
 
Analysis of variance (anova)
Analysis of variance (anova)Analysis of variance (anova)
Analysis of variance (anova)
 
Statistics for Anaesthesiologists
Statistics for AnaesthesiologistsStatistics for Anaesthesiologists
Statistics for Anaesthesiologists
 
Statistical Tools
Statistical ToolsStatistical Tools
Statistical Tools
 
12-5-03.ppt
12-5-03.ppt12-5-03.ppt
12-5-03.ppt
 
12-5-03.ppt
12-5-03.ppt12-5-03.ppt
12-5-03.ppt
 
Calculating Analysis of Variance (ANOVA) and Post Hoc Analyses Follo.docx
Calculating Analysis of Variance (ANOVA) and Post Hoc Analyses Follo.docxCalculating Analysis of Variance (ANOVA) and Post Hoc Analyses Follo.docx
Calculating Analysis of Variance (ANOVA) and Post Hoc Analyses Follo.docx
 

Analysis of covariance

  • 1. Analysis of Covariance David Markham djmarkham@bsu.edu
  • 2. Analysis of Covariance  Analysis of Covariance (ANCOVA) is a statistical test related to ANOVA  It tests whether there is a significant difference between groups after controlling for variance explained by a covariate  A covariate is a continuous variable that correlates with the dependent variable
  • 3. So, what does all that mean?  This means that you can, in effect, “partial out” a continuous variable and run an ANOVA on the results  This is one way that you can run a statistical test with both categorical and continuous independent variables
  • 4. Hypotheses for ANCOVA  H0 and H1 need to be stated slightly differently for an ANCOVA than a regular ANOVA  H0: the group means are equal after controlling for the covariate  H1: the group means are not equal after controlling for the covariate
  • 5. Assumptions for ANCOVA ANOVA assumptions:  Variance is normally distributed  Variance is equal between groups  All measurements are independent Also, for ANCOVA:  Relationship between DV and covariate is linear  The relationship between the DV and covariate is the same for all groups
  • 6. How does ANCOVA work?  ANCOVA works by adjusting the total SS, group SS, and error SS of the independent variable to remove the influence of the covariate  However, the sums of squares must also be calculated for the covariate. For this reason, SSdv will be used for SS scores for the dependent variable, and SScv will be used for the covariate
  • 8. Sum of Products  To control for the covariate, the sum of products (SP) for the DV and covariate must also be used  This is the sum of the products of the residuals for both the DV and the covariate  In the following slides, x is the covariate, and y is the DV. i is the individual subject, and j is the group.
  • 9. Total Sum of Products ))(( yyxxtotalSP ij j i ijxy    This is just the sum of the multiplied residuals for all data points.
  • 10. Group Sum of Products )()( yyxxngroupSP j j jjxy    This is the sum of the products of the group means minus the grand means times the group size.
  • 11. Error Sum of Products groupSPtotalSPerrorSP yyxxerrorSP xyxyxy jij j i jijxy    ))((  This is the sum of the products of the DV and residual minus the group means of the DV and residual  This just happens to be the same as the difference between the other two sum of products
  • 12. Adjusting the Sum of Squares  Using the SS’s for the covariate and the DV, and the SP’s, we can adjust the SS’s for the DV
  • 13. Sum of Squares       errorSS errorSP errorSSadjerrorSS totalSS totalSP errorSS errorSP groupSSadjgroupSS totalSS totalSP totalSSadjtotalSS x xy yy x xy x xy yy x xy yy 2 22 2 )(   
  • 14. Now what?  Using the adjusted SS’s, we can now run an ANOVA to see if there is a difference between groups.  This is the exact same as a regular ANOVA, but using the adjusted SS’s instead of the original ones.  Degrees of freedom are not affected
  • 15. A few more things  We can also determine whether the covariate is significant by getting a F score   adjtotalSS N totalSS totalSP NF y x xy 2 )( )2,1( 2          
  • 16. A few more things  The group means can also be adjusted to eliminate the effect of the covariate  xx errorSS errorSP yyadj j x xy jj         
  • 17. Post-hocs for ANCOVA  Post-hoc tests can be done using the adjusted means for ANCOVA, including LSD and Bonferroni
  • 18. Example of ANCOVA  Imagine we gave subjects a self-esteem test, with scores of 1 to 10  Then we primed subjects with either positive or negative emotions.  Then we asked them to spend a few minutes writing about themselves.  Our dependent measure is the number of positive emotion words they used (e.g. happy, good)
  • 19.  The null hypothesis is that the priming doesn’t make a difference after controlling for self-esteem  The alternative hypothesis is that the priming does make a difference after controlling for self-esteem Example of ANCOVA, cont.
  • 20. Data Subject # Priming Self-Esteem Positive Words 1 Positive 1 7 2 Positive 5 10 3 Positive 7 11 4 Negative 8 7 5 Negative 3 4 6 Negative 6 5
  • 21. ANCOVA in SPSS  To do ANCOVA in SPSS, all you need to do is add your covariate to the “covariate” box in the “univariate” menu  Everything else is the exact same as it is for ANOVA