SlideShare a Scribd company logo
Lab 5 – Assumptions of ANOVA
September 17 & 18, 2018
FANR 6750
Richard Chandler and Bob Cooper
Today’s Topics
1 Assumptions of ANOVA
2 Transformations
3 Non-parametrics
Assumptions of ANOVA
A common misconception is that the response variable must be
normally distributed when conducting an ANOVA.
Assumptions of ANOVA Transformations Non-parametrics 3 / 16
Assumptions of ANOVA
A common misconception is that the response variable must be
normally distributed when conducting an ANOVA.
This is incorrect because the normality assumptions pertain to the
residuals, not the response variable. The key assumption of
ANOVA is that the residuals are independent and come from a
normal distribution with mean 0 and variance σ2.
Assumptions of ANOVA Transformations Non-parametrics 3 / 16
Assumptions of ANOVA
A common misconception is that the response variable must be
normally distributed when conducting an ANOVA.
This is incorrect because the normality assumptions pertain to the
residuals, not the response variable. The key assumption of
ANOVA is that the residuals are independent and come from a
normal distribution with mean 0 and variance σ2.
yij = µ + αi + εij
εij ∼ Normal(0, σ2
)
Assumptions of ANOVA Transformations Non-parametrics 3 / 16
Assumptions of ANOVA
A common misconception is that the response variable must be
normally distributed when conducting an ANOVA.
This is incorrect because the normality assumptions pertain to the
residuals, not the response variable. The key assumption of
ANOVA is that the residuals are independent and come from a
normal distribution with mean 0 and variance σ2.
yij = µ + αi + εij
εij ∼ Normal(0, σ2
)
We can assess this assumption by looking at the residuals
themselves or the data within each treatment
Assumptions of ANOVA Transformations Non-parametrics 3 / 16
Normality diagnostics
Consider the data:
infectionRates <- read.csv("infectionRates.csv")
str(infectionRates)
## 'data.frame': 90 obs. of 2 variables:
## $ percentInfected: num 0.21 0.25 0.17 0.26 0.21 0.21 0.22 0.27 0.23 0.14 ...
## $ landscape : Factor w/ 3 levels "Park","Suburban",..: 1 1 1 1 1 1 1 1 1 1 ...
summary(infectionRates)
## percentInfected landscape
## Min. :0.010 Park :30
## 1st Qu.:0.040 Suburban:30
## Median :0.090 Urban :30
## Mean :0.121
## 3rd Qu.:0.210
## Max. :0.330
These data are made-up, but imagine they come from a study in which
100 crows are placed in n = 30 enclosures in each of 3 landscapes. The
response variable is the proportion of crows infected with West Nile virus
at the end of the study.
Assumptions of ANOVA Transformations Non-parametrics 4 / 16
ANOVA diagnostics
anova1 <- aov(percentInfected ~ landscape,
data=infectionRates)
summary(anova1)
## Df Sum Sq Mean Sq F value Pr(>F)
## landscape 2 0.6384 0.3192 306 <2e-16 ***
## Residuals 87 0.0908 0.0010
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Assumptions of ANOVA Transformations Non-parametrics 5 / 16
ANOVA diagnostics
anova1 <- aov(percentInfected ~ landscape,
data=infectionRates)
summary(anova1)
## Df Sum Sq Mean Sq F value Pr(>F)
## landscape 2 0.6384 0.3192 306 <2e-16 ***
## Residuals 87 0.0908 0.0010
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Significant, but did we meet the assumptions?
Assumptions of ANOVA Transformations Non-parametrics 5 / 16
Boxplots
boxplot(percentInfected~landscape, infectionRates,
col="lightgreen", cex.lab=1.5, cex.axis=1.3,
ylab="Percent forest cover")
Park Suburban Urban
0.000.050.100.150.200.250.30
Percentforestcover
Assumptions of ANOVA Transformations Non-parametrics 6 / 16
Are group variances equal?
bartlett.test(percentInfected~landscape, data=infectionRates)
##
## Bartlett test of homogeneity of variances
##
## data: percentInfected by landscape
## Bartlett's K-squared = 42.926, df = 2, p-value = 4.773e-10
We reject the null hypothesis that the group variances are equal
Assumptions of ANOVA Transformations Non-parametrics 7 / 16
Histogram of residuals
resids <- resid(anova1)
hist(resids, col="turquoise", breaks=10, xlab="Residuals")
Histogram of resids
Residuals
Frequency
−0.10 −0.05 0.00 0.05 0.10
051015202530
Assumptions of ANOVA Transformations Non-parametrics 8 / 16
Normality test on residuals
shapiro.test(resids)
##
## Shapiro-Wilk normality test
##
## data: resids
## W = 0.95528, p-value = 0.003596
Assumptions of ANOVA Transformations Non-parametrics 9 / 16
Normality test on residuals
shapiro.test(resids)
##
## Shapiro-Wilk normality test
##
## data: resids
## W = 0.95528, p-value = 0.003596
We reject the null hypothesis that the residuals come from a
normal distribution. Time to consider transformations and/or
nonparametric tests.
Assumptions of ANOVA Transformations Non-parametrics 9 / 16
Logarithmic Transformation
y = log(u + C)
• The constant C is often 1, or 0 if there are no zeros in the
data (u)
• Useful when group variances are proportional to the means
Assumptions of ANOVA Transformations Non-parametrics 10 / 16
Square Root Transformation
y =
√
u + C
• C is often 0.5 or some other small number
• Useful when group variances are proportional to the means
Assumptions of ANOVA Transformations Non-parametrics 11 / 16
Arcsine-square root Transformation
y = arcsin(
√
u)
• Used on proportions.
• logit transformation is an alternative: y = log( u
1−u
)
Assumptions of ANOVA Transformations Non-parametrics 12 / 16
Reciprocal Transformation
y =
1
u + C
• C is often 1 but could be 0 if there are no zeros in u
• Useful when group SDs are proportional to the squared
group means
Assumptions of ANOVA Transformations Non-parametrics 13 / 16
ANOVA on transformed data
Tranformation can be done in the aov formula
anova2 <- aov(log(percentInfected)~landscape,
data=infectionRates)
summary(anova2)
## Df Sum Sq Mean Sq F value Pr(>F)
## landscape 2 60.93 30.46 303.5 <2e-16 ***
## Residuals 87 8.73 0.10
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Assumptions of ANOVA Transformations Non-parametrics 14 / 16
ANOVA on transformed data
Tranformation can be done in the aov formula
anova2 <- aov(log(percentInfected)~landscape,
data=infectionRates)
summary(anova2)
## Df Sum Sq Mean Sq F value Pr(>F)
## landscape 2 60.93 30.46 303.5 <2e-16 ***
## Residuals 87 8.73 0.10
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Now we fail to reject the normality assumption – good news
shapiro.test(resid(anova2))
##
## Shapiro-Wilk normality test
##
## data: resid(anova2)
## W = 0.97092, p-value = 0.04106
Assumptions of ANOVA Transformations Non-parametrics 14 / 16
Non-parametric Tests
Wilcoxan rank sum test
• For 2 group comparisons
• a.k.a. the Mann-Whitney U test
• wilcox.test
Assumptions of ANOVA Transformations Non-parametrics 15 / 16
Non-parametric Tests
Wilcoxan rank sum test
• For 2 group comparisons
• a.k.a. the Mann-Whitney U test
• wilcox.test
Kruskal-Wallis One-Way ANOVA
• For testing differences in > 2 groups
• kruskal.test
Assumptions of ANOVA Transformations Non-parametrics 15 / 16
Non-parametric Tests
Wilcoxan rank sum test
• For 2 group comparisons
• a.k.a. the Mann-Whitney U test
• wilcox.test
Kruskal-Wallis One-Way ANOVA
• For testing differences in > 2 groups
• kruskal.test
These two functions can be used in almost the exact same way
as t.test and aov , respectively.
Assumptions of ANOVA Transformations Non-parametrics 15 / 16
Assignment
(1) Decide which transformation is best for the infectionRates data by
conducting an ANOVA on the untransformed and transformed data. Use
graphical assessments, Bartlett’s test, and Shapiro’s test to evaluate each
of the following tranformations:
log
square-root
acrsine square-root
reciprocal
(2) Does transformation alter the conclusion about the null hypothesis of no
difference in means? If not, were the transformations necessary?
(3) Test the hypothesis that infection rates are equal between suburban and
urban landscapes using a Wilcoxan rank sum test. What is the
conclusion?
(4) Conduct a Kruskal-Wallis test on the data. What is the conclusion?
Use comments in your R script to explain your answers. Upload your results to
ELC at least one day before your next lab.
Assumptions of ANOVA Transformations Non-parametrics 16 / 16

More Related Content

What's hot

The mann whitney u test
The mann whitney u testThe mann whitney u test
The mann whitney u test
Regent University
 
non parametric statistics
non parametric statisticsnon parametric statistics
non parametric statistics
Anchal Garg
 
Hypothesis Testing
Hypothesis TestingHypothesis Testing
Hypothesis Testing
Khemraj Subedi
 
Skewness and kurtosis
Skewness and kurtosisSkewness and kurtosis
Skewness and kurtosis
KalimaniH
 
Normal distribution
Normal distributionNormal distribution
Normal distribution
SonamWadhwa3
 
Factor analysis
Factor analysisFactor analysis
Factor analysissaba khan
 
Inferential statistics
Inferential statisticsInferential statistics
Inferential statistics
Ashok Kulkarni
 
Inferential statistics.ppt
Inferential statistics.pptInferential statistics.ppt
Inferential statistics.pptNursing Path
 
Binomial and Poission Probablity distribution
Binomial and Poission Probablity distributionBinomial and Poission Probablity distribution
Binomial and Poission Probablity distribution
Prateek Singla
 
Coefficient of Variance
Coefficient of VarianceCoefficient of Variance
Coefficient of Variance
Dr. Amjad Ali Arain
 
Regression
Regression Regression
Regression
Ali Raza
 
Population and Sample
Population and SamplePopulation and Sample
Population and Sample
Dr. Amjad Ali Arain
 
Parametric and nonparametric test
Parametric and nonparametric testParametric and nonparametric test
Parametric and nonparametric test
ponnienselvi
 
Degree of freedom
Degree of freedomDegree of freedom
Degree of freedom
StepUp Analytics
 
Analysis of covariance
Analysis of covarianceAnalysis of covariance
Analysis of covariancemikko656
 
Different types of distributions
Different types of distributionsDifferent types of distributions
Different types of distributions
RajaKrishnan M
 

What's hot (20)

The mann whitney u test
The mann whitney u testThe mann whitney u test
The mann whitney u test
 
Hypothesis Testing
Hypothesis TestingHypothesis Testing
Hypothesis Testing
 
non parametric statistics
non parametric statisticsnon parametric statistics
non parametric statistics
 
Hypothesis Testing
Hypothesis TestingHypothesis Testing
Hypothesis Testing
 
Analysis of variance anova
Analysis of variance anovaAnalysis of variance anova
Analysis of variance anova
 
Skewness and kurtosis
Skewness and kurtosisSkewness and kurtosis
Skewness and kurtosis
 
Normal distribution
Normal distributionNormal distribution
Normal distribution
 
Factor analysis
Factor analysisFactor analysis
Factor analysis
 
Inferential statistics
Inferential statisticsInferential statistics
Inferential statistics
 
Inferential statistics.ppt
Inferential statistics.pptInferential statistics.ppt
Inferential statistics.ppt
 
Binomial and Poission Probablity distribution
Binomial and Poission Probablity distributionBinomial and Poission Probablity distribution
Binomial and Poission Probablity distribution
 
Coefficient of Variance
Coefficient of VarianceCoefficient of Variance
Coefficient of Variance
 
Regression
Regression Regression
Regression
 
Population and Sample
Population and SamplePopulation and Sample
Population and Sample
 
Z test
Z testZ test
Z test
 
Parametric and nonparametric test
Parametric and nonparametric testParametric and nonparametric test
Parametric and nonparametric test
 
Degree of freedom
Degree of freedomDegree of freedom
Degree of freedom
 
Analysis of covariance
Analysis of covarianceAnalysis of covariance
Analysis of covariance
 
Non-Parametric Tests
Non-Parametric TestsNon-Parametric Tests
Non-Parametric Tests
 
Different types of distributions
Different types of distributionsDifferent types of distributions
Different types of distributions
 

Similar to Assumptions of ANOVA

Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysis
Michael770443
 
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
Paravayya Pujeri
 
10.Analysis of Variance.ppt
10.Analysis of Variance.ppt10.Analysis of Variance.ppt
10.Analysis of Variance.ppt
AbdulhaqAli
 
U1.4-RVDistributions.ppt
U1.4-RVDistributions.pptU1.4-RVDistributions.ppt
U1.4-RVDistributions.ppt
Sameeraasif2
 
604_multiplee.ppt
604_multiplee.ppt604_multiplee.ppt
604_multiplee.ppt
Rufesh
 
Test for equal variances
Test for equal variancesTest for equal variances
Test for equal variances
John Smith
 
Analysis of Variance (ANOVA), MANOVA: Expected variance components, Random an...
Analysis of Variance (ANOVA), MANOVA: Expected variance components, Random an...Analysis of Variance (ANOVA), MANOVA: Expected variance components, Random an...
Analysis of Variance (ANOVA), MANOVA: Expected variance components, Random an...
Satish Khadia
 
Analysis of variance (anova)
Analysis of variance (anova)Analysis of variance (anova)
Analysis of variance (anova)
Sadhana Singh
 
Mba2216 week 11 data analysis part 02
Mba2216 week 11 data analysis part 02Mba2216 week 11 data analysis part 02
Mba2216 week 11 data analysis part 02
Stephen Ong
 
Inorganic CHEMISTRY
Inorganic CHEMISTRYInorganic CHEMISTRY
Inorganic CHEMISTRY
Saikumar raja
 
Repeated measures analysis in R
Repeated measures analysis in RRepeated measures analysis in R
Repeated measures analysis in R
richardchandler
 
Analysis of Variance
Analysis of VarianceAnalysis of Variance
Analysis of Variance
Shailesh Dewangan
 
ANCOVA in R
ANCOVA in RANCOVA in R
ANCOVA in R
richardchandler
 
Linear regression analysis
Linear regression analysisLinear regression analysis
Linear regression analysis
Dhritiman Chakrabarti
 
2.0.statistical methods and determination of sample size
2.0.statistical methods and determination of sample size2.0.statistical methods and determination of sample size
2.0.statistical methods and determination of sample size
salummkata1
 
Multiple regression
Multiple regressionMultiple regression
Multiple regression
Antoine De Henau
 
lecture-2.ppt
lecture-2.pptlecture-2.ppt
lecture-2.ppt
Noorelhuda2
 
Design of experiments(
Design of experiments(Design of experiments(
Design of experiments(
Nugurusaichandan
 

Similar to Assumptions of ANOVA (20)

Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysis
 
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
 
10.Analysis of Variance.ppt
10.Analysis of Variance.ppt10.Analysis of Variance.ppt
10.Analysis of Variance.ppt
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
U1.4-RVDistributions.ppt
U1.4-RVDistributions.pptU1.4-RVDistributions.ppt
U1.4-RVDistributions.ppt
 
Stats chapter 15
Stats chapter 15Stats chapter 15
Stats chapter 15
 
604_multiplee.ppt
604_multiplee.ppt604_multiplee.ppt
604_multiplee.ppt
 
Test for equal variances
Test for equal variancesTest for equal variances
Test for equal variances
 
Analysis of Variance (ANOVA), MANOVA: Expected variance components, Random an...
Analysis of Variance (ANOVA), MANOVA: Expected variance components, Random an...Analysis of Variance (ANOVA), MANOVA: Expected variance components, Random an...
Analysis of Variance (ANOVA), MANOVA: Expected variance components, Random an...
 
Analysis of variance (anova)
Analysis of variance (anova)Analysis of variance (anova)
Analysis of variance (anova)
 
Mba2216 week 11 data analysis part 02
Mba2216 week 11 data analysis part 02Mba2216 week 11 data analysis part 02
Mba2216 week 11 data analysis part 02
 
Inorganic CHEMISTRY
Inorganic CHEMISTRYInorganic CHEMISTRY
Inorganic CHEMISTRY
 
Repeated measures analysis in R
Repeated measures analysis in RRepeated measures analysis in R
Repeated measures analysis in R
 
Analysis of Variance
Analysis of VarianceAnalysis of Variance
Analysis of Variance
 
ANCOVA in R
ANCOVA in RANCOVA in R
ANCOVA in R
 
Linear regression analysis
Linear regression analysisLinear regression analysis
Linear regression analysis
 
2.0.statistical methods and determination of sample size
2.0.statistical methods and determination of sample size2.0.statistical methods and determination of sample size
2.0.statistical methods and determination of sample size
 
Multiple regression
Multiple regressionMultiple regression
Multiple regression
 
lecture-2.ppt
lecture-2.pptlecture-2.ppt
lecture-2.ppt
 
Design of experiments(
Design of experiments(Design of experiments(
Design of experiments(
 

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 Inference
richardchandler
 
Introduction to Generalized Linear Models
Introduction to Generalized Linear ModelsIntroduction to Generalized Linear Models
Introduction to Generalized Linear Models
richardchandler
 
Introduction to statistical modeling in R
Introduction to statistical modeling in RIntroduction to statistical modeling in R
Introduction to statistical modeling in R
richardchandler
 
Split-plot Designs
Split-plot DesignsSplit-plot Designs
Split-plot Designs
richardchandler
 
Nested Designs
Nested DesignsNested Designs
Nested Designs
richardchandler
 
Factorial designs
Factorial designsFactorial designs
Factorial designs
richardchandler
 
Blocking lab
Blocking labBlocking lab
Blocking lab
richardchandler
 
Lab on contrasts, estimation, and power
Lab on contrasts, estimation, and powerLab on contrasts, estimation, and power
Lab on contrasts, estimation, and power
richardchandler
 
One-way ANOVA
One-way ANOVAOne-way ANOVA
One-way ANOVA
richardchandler
 
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
richardchandler
 
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
richardchandler
 
Hierarchichal species distributions model and Maxent
Hierarchichal species distributions model and MaxentHierarchichal species distributions model and Maxent
Hierarchichal species distributions model and Maxent
richardchandler
 
Slides from ESA 2015
Slides from ESA 2015Slides from ESA 2015
Slides from ESA 2015
richardchandler
 
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
richardchandler
 

More from richardchandler (15)

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
 
Lab on contrasts, estimation, and power
Lab on contrasts, estimation, and powerLab on contrasts, estimation, and power
Lab on contrasts, estimation, and power
 
One-way ANOVA
One-way ANOVAOne-way ANOVA
One-way 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

GBSN- Microbiology (Lab 3) Gram Staining
GBSN- Microbiology (Lab 3) Gram StainingGBSN- Microbiology (Lab 3) Gram Staining
GBSN- Microbiology (Lab 3) Gram Staining
Areesha Ahmad
 
platelets- lifespan -Clot retraction-disorders.pptx
platelets- lifespan -Clot retraction-disorders.pptxplatelets- lifespan -Clot retraction-disorders.pptx
platelets- lifespan -Clot retraction-disorders.pptx
muralinath2
 
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
NathanBaughman3
 
Comparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebratesComparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebrates
sachin783648
 
Mammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also FunctionsMammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also Functions
YOGESH DOGRA
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Sérgio Sacani
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
AlaminAfendy1
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
AlguinaldoKong
 
Nutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technologyNutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technology
Lokesh Patil
 
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of LipidsGBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
Areesha Ahmad
 
Hemostasis_importance& clinical significance.pptx
Hemostasis_importance& clinical significance.pptxHemostasis_importance& clinical significance.pptx
Hemostasis_importance& clinical significance.pptx
muralinath2
 
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdfSCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SELF-EXPLANATORY
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
muralinath2
 
ESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptxESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptx
muralinath2
 
Cancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate PathwayCancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate Pathway
AADYARAJPANDEY1
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
Sérgio Sacani
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
Richard Gill
 
The ASGCT Annual Meeting was packed with exciting progress in the field advan...
The ASGCT Annual Meeting was packed with exciting progress in the field advan...The ASGCT Annual Meeting was packed with exciting progress in the field advan...
The ASGCT Annual Meeting was packed with exciting progress in the field advan...
Health Advances
 
GBSN - Microbiology (Lab 4) Culture Media
GBSN - Microbiology (Lab 4) Culture MediaGBSN - Microbiology (Lab 4) Culture Media
GBSN - Microbiology (Lab 4) Culture Media
Areesha Ahmad
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Sérgio Sacani
 

Recently uploaded (20)

GBSN- Microbiology (Lab 3) Gram Staining
GBSN- Microbiology (Lab 3) Gram StainingGBSN- Microbiology (Lab 3) Gram Staining
GBSN- Microbiology (Lab 3) Gram Staining
 
platelets- lifespan -Clot retraction-disorders.pptx
platelets- lifespan -Clot retraction-disorders.pptxplatelets- lifespan -Clot retraction-disorders.pptx
platelets- lifespan -Clot retraction-disorders.pptx
 
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
 
Comparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebratesComparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebrates
 
Mammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also FunctionsMammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also Functions
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
 
Nutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technologyNutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technology
 
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of LipidsGBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
 
Hemostasis_importance& clinical significance.pptx
Hemostasis_importance& clinical significance.pptxHemostasis_importance& clinical significance.pptx
Hemostasis_importance& clinical significance.pptx
 
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdfSCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
 
ESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptxESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptx
 
Cancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate PathwayCancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate Pathway
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
 
The ASGCT Annual Meeting was packed with exciting progress in the field advan...
The ASGCT Annual Meeting was packed with exciting progress in the field advan...The ASGCT Annual Meeting was packed with exciting progress in the field advan...
The ASGCT Annual Meeting was packed with exciting progress in the field advan...
 
GBSN - Microbiology (Lab 4) Culture Media
GBSN - Microbiology (Lab 4) Culture MediaGBSN - Microbiology (Lab 4) Culture Media
GBSN - Microbiology (Lab 4) Culture Media
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
 

Assumptions of ANOVA

  • 1. Lab 5 – Assumptions of ANOVA September 17 & 18, 2018 FANR 6750 Richard Chandler and Bob Cooper
  • 2. Today’s Topics 1 Assumptions of ANOVA 2 Transformations 3 Non-parametrics
  • 3. Assumptions of ANOVA A common misconception is that the response variable must be normally distributed when conducting an ANOVA. Assumptions of ANOVA Transformations Non-parametrics 3 / 16
  • 4. Assumptions of ANOVA A common misconception is that the response variable must be normally distributed when conducting an ANOVA. This is incorrect because the normality assumptions pertain to the residuals, not the response variable. The key assumption of ANOVA is that the residuals are independent and come from a normal distribution with mean 0 and variance σ2. Assumptions of ANOVA Transformations Non-parametrics 3 / 16
  • 5. Assumptions of ANOVA A common misconception is that the response variable must be normally distributed when conducting an ANOVA. This is incorrect because the normality assumptions pertain to the residuals, not the response variable. The key assumption of ANOVA is that the residuals are independent and come from a normal distribution with mean 0 and variance σ2. yij = µ + αi + εij εij ∼ Normal(0, σ2 ) Assumptions of ANOVA Transformations Non-parametrics 3 / 16
  • 6. Assumptions of ANOVA A common misconception is that the response variable must be normally distributed when conducting an ANOVA. This is incorrect because the normality assumptions pertain to the residuals, not the response variable. The key assumption of ANOVA is that the residuals are independent and come from a normal distribution with mean 0 and variance σ2. yij = µ + αi + εij εij ∼ Normal(0, σ2 ) We can assess this assumption by looking at the residuals themselves or the data within each treatment Assumptions of ANOVA Transformations Non-parametrics 3 / 16
  • 7. Normality diagnostics Consider the data: infectionRates <- read.csv("infectionRates.csv") str(infectionRates) ## 'data.frame': 90 obs. of 2 variables: ## $ percentInfected: num 0.21 0.25 0.17 0.26 0.21 0.21 0.22 0.27 0.23 0.14 ... ## $ landscape : Factor w/ 3 levels "Park","Suburban",..: 1 1 1 1 1 1 1 1 1 1 ... summary(infectionRates) ## percentInfected landscape ## Min. :0.010 Park :30 ## 1st Qu.:0.040 Suburban:30 ## Median :0.090 Urban :30 ## Mean :0.121 ## 3rd Qu.:0.210 ## Max. :0.330 These data are made-up, but imagine they come from a study in which 100 crows are placed in n = 30 enclosures in each of 3 landscapes. The response variable is the proportion of crows infected with West Nile virus at the end of the study. Assumptions of ANOVA Transformations Non-parametrics 4 / 16
  • 8. ANOVA diagnostics anova1 <- aov(percentInfected ~ landscape, data=infectionRates) summary(anova1) ## Df Sum Sq Mean Sq F value Pr(>F) ## landscape 2 0.6384 0.3192 306 <2e-16 *** ## Residuals 87 0.0908 0.0010 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Assumptions of ANOVA Transformations Non-parametrics 5 / 16
  • 9. ANOVA diagnostics anova1 <- aov(percentInfected ~ landscape, data=infectionRates) summary(anova1) ## Df Sum Sq Mean Sq F value Pr(>F) ## landscape 2 0.6384 0.3192 306 <2e-16 *** ## Residuals 87 0.0908 0.0010 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Significant, but did we meet the assumptions? Assumptions of ANOVA Transformations Non-parametrics 5 / 16
  • 10. Boxplots boxplot(percentInfected~landscape, infectionRates, col="lightgreen", cex.lab=1.5, cex.axis=1.3, ylab="Percent forest cover") Park Suburban Urban 0.000.050.100.150.200.250.30 Percentforestcover Assumptions of ANOVA Transformations Non-parametrics 6 / 16
  • 11. Are group variances equal? bartlett.test(percentInfected~landscape, data=infectionRates) ## ## Bartlett test of homogeneity of variances ## ## data: percentInfected by landscape ## Bartlett's K-squared = 42.926, df = 2, p-value = 4.773e-10 We reject the null hypothesis that the group variances are equal Assumptions of ANOVA Transformations Non-parametrics 7 / 16
  • 12. Histogram of residuals resids <- resid(anova1) hist(resids, col="turquoise", breaks=10, xlab="Residuals") Histogram of resids Residuals Frequency −0.10 −0.05 0.00 0.05 0.10 051015202530 Assumptions of ANOVA Transformations Non-parametrics 8 / 16
  • 13. Normality test on residuals shapiro.test(resids) ## ## Shapiro-Wilk normality test ## ## data: resids ## W = 0.95528, p-value = 0.003596 Assumptions of ANOVA Transformations Non-parametrics 9 / 16
  • 14. Normality test on residuals shapiro.test(resids) ## ## Shapiro-Wilk normality test ## ## data: resids ## W = 0.95528, p-value = 0.003596 We reject the null hypothesis that the residuals come from a normal distribution. Time to consider transformations and/or nonparametric tests. Assumptions of ANOVA Transformations Non-parametrics 9 / 16
  • 15. Logarithmic Transformation y = log(u + C) • The constant C is often 1, or 0 if there are no zeros in the data (u) • Useful when group variances are proportional to the means Assumptions of ANOVA Transformations Non-parametrics 10 / 16
  • 16. Square Root Transformation y = √ u + C • C is often 0.5 or some other small number • Useful when group variances are proportional to the means Assumptions of ANOVA Transformations Non-parametrics 11 / 16
  • 17. Arcsine-square root Transformation y = arcsin( √ u) • Used on proportions. • logit transformation is an alternative: y = log( u 1−u ) Assumptions of ANOVA Transformations Non-parametrics 12 / 16
  • 18. Reciprocal Transformation y = 1 u + C • C is often 1 but could be 0 if there are no zeros in u • Useful when group SDs are proportional to the squared group means Assumptions of ANOVA Transformations Non-parametrics 13 / 16
  • 19. ANOVA on transformed data Tranformation can be done in the aov formula anova2 <- aov(log(percentInfected)~landscape, data=infectionRates) summary(anova2) ## Df Sum Sq Mean Sq F value Pr(>F) ## landscape 2 60.93 30.46 303.5 <2e-16 *** ## Residuals 87 8.73 0.10 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Assumptions of ANOVA Transformations Non-parametrics 14 / 16
  • 20. ANOVA on transformed data Tranformation can be done in the aov formula anova2 <- aov(log(percentInfected)~landscape, data=infectionRates) summary(anova2) ## Df Sum Sq Mean Sq F value Pr(>F) ## landscape 2 60.93 30.46 303.5 <2e-16 *** ## Residuals 87 8.73 0.10 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Now we fail to reject the normality assumption – good news shapiro.test(resid(anova2)) ## ## Shapiro-Wilk normality test ## ## data: resid(anova2) ## W = 0.97092, p-value = 0.04106 Assumptions of ANOVA Transformations Non-parametrics 14 / 16
  • 21. Non-parametric Tests Wilcoxan rank sum test • For 2 group comparisons • a.k.a. the Mann-Whitney U test • wilcox.test Assumptions of ANOVA Transformations Non-parametrics 15 / 16
  • 22. Non-parametric Tests Wilcoxan rank sum test • For 2 group comparisons • a.k.a. the Mann-Whitney U test • wilcox.test Kruskal-Wallis One-Way ANOVA • For testing differences in > 2 groups • kruskal.test Assumptions of ANOVA Transformations Non-parametrics 15 / 16
  • 23. Non-parametric Tests Wilcoxan rank sum test • For 2 group comparisons • a.k.a. the Mann-Whitney U test • wilcox.test Kruskal-Wallis One-Way ANOVA • For testing differences in > 2 groups • kruskal.test These two functions can be used in almost the exact same way as t.test and aov , respectively. Assumptions of ANOVA Transformations Non-parametrics 15 / 16
  • 24. Assignment (1) Decide which transformation is best for the infectionRates data by conducting an ANOVA on the untransformed and transformed data. Use graphical assessments, Bartlett’s test, and Shapiro’s test to evaluate each of the following tranformations: log square-root acrsine square-root reciprocal (2) Does transformation alter the conclusion about the null hypothesis of no difference in means? If not, were the transformations necessary? (3) Test the hypothesis that infection rates are equal between suburban and urban landscapes using a Wilcoxan rank sum test. What is the conclusion? (4) Conduct a Kruskal-Wallis test on the data. What is the conclusion? Use comments in your R script to explain your answers. Upload your results to ELC at least one day before your next lab. Assumptions of ANOVA Transformations Non-parametrics 16 / 16