Skip to content
Learn Plant Science

Learn Plant Science

Explore the the green world with us

  • Home
  • Statistics – Experimental Design & Data Analysis Using R
  • ANOVA test
code, coding, programming-2558220.jpg

ANOVA test

Posted on January 27, 2023March 21, 2023 By Janith Piumal No Comments on ANOVA test
Statistics – Experimental Design & Data Analysis Using R

Analysis of variance

An ANOVA test is used to compare means between more than two groups. One-way ANOVA uses one independent variable, and two-way ANOVA uses two independent variables.(two factors that are being tested simultaneously)

Two main aim of ANOVA tests

  • To explain the relative contribution of the different factors or combination of different factors to response variable /dependent variable
  • To test the null hypothesis/ means of the population groups are equal

An ANOVA test is important to identify which factors (independent variables) have a significant effect on the response variables, and how much variability in the response variables is attributed to the response variables. This variability is measured as the sum of squares.

Assumption of ANOVA

  • Samples are independent
  • Response variable should be measured at continuous level
  • Response variables should be normally distributed
  • Each population have same variance

EXAMPLE 1

weight (levels) R1 R2 R3 R4 R5 Mean
45Kg12151179
55Kg111311810
65Kg111321911
Table 2: Data table
  • n = Total No. of data
  • T = Row
  • c = No. of replicate.

SST = ∑ (X2) – (∑X)2/n

SSL = (∑ (Ti2))/c – (∑X)2/n

SSE = ∑ (X2) – ∑(Ti)2/c

SST= SSL + SSE

ANOVA table

Source of variation Degree of freedom (df) Sum of square (SS) Mean square (MS) F
between/treatmentsdfLSSLSSL/dfLMSL/MSE
within/errordfT – dfLSST – SSL(SST – SSL)/(dfT – dfL)
TotaldfTSST
Table 2 : ANOVA table

dfL (treatments)= t -1

dfT (Total) = n-1

dfE (error) = n – t

dfT = dfL + dfE

Critical value is find by F – distribution tables,

If calculated value is greater than the critical value (FCAL > F CRI ) null hypothesis rejected & accept the alternative hypothesis

Multiple comparison Tests

If ANOVA found there is a significant effect from one or factors (independent variables) to the response variable, repeated T – tests are performed (post hoc comparisons) to find which means are significantly different from one another, such as Tukey’s HSD test, Tukey’s Kramer test and Fisher’s LSD test

  • Tukey’s HSD test can be performed with the equal group sizes
  • Tukey’s Kramer test and Fisher’s LSD test can be performed with both equal and unequal groups sizes.
  • if the mean difference is greater than the critical value, mean of the two populations are significantly different.

ANOVA test in R

# ONE WAY ANOVA
#Creates a boxplot
boxplot(Dependent_Variable ~ Factor, main, xlab, ylab, col)

#Test for normality
shapiro.test(Dependent_variable)

#ONE WAY ANOVA test
one_way_anova <- aov(Dependent_Variable ~ Factor)
summary (one_way_anova)

#post-hos test
TukeyHSD(one_way_anova, conf.level=0.95)

#TWO WAY ANOVA 
#Creates a boxplot
boxplot(Dependent_Variable ~ Factor1:Factor2:Factor3, main, xlab, ylab, col)

#Test for normality
shapiro.test(Dependent_variable)

#TWO WAY ANOVA test
two_way_anova <- aov(Dependent_Variable ~ Factor1+Factor2+Factor3)
summary (two_way_anova)

#post-hos test
TukeyHSD(two_way_anova, conf.level=0.95)

Post navigation

❮ Previous Post: Z – test & T – Test in R
Next Post: Statistical Errors. ❯

You may also like

accountant, counting, calculation-1794122.jpg
Statistics – Experimental Design & Data Analysis Using R
Experimental Design Models
March 4, 2023
analytics, seo, analysis-1907993.jpg
Statistics – Experimental Design & Data Analysis Using R
Multivariate Analysis
March 18, 2023
code, coding, web-944499.jpg
Statistics – Experimental Design & Data Analysis Using R
Z – test & T – Test in R
January 27, 2023
online, web, statistics-3539409.jpg
Statistics – Experimental Design & Data Analysis Using R
Sign Test
January 30, 2023

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Blog
  • Environment science
  • Horticulture
  • Microbiology
  • Molecular Biology
  • Phylogenetic
  • Plant Breeding
  • Statistics – Experimental Design & Data Analysis Using R
  • Uncategorized

Recent Posts

  • R for Phylogenetic
  • Character based approach of phylogenetic analysis
  • Distance based approach of phylogenetic analysis
  • Phylogenetic Analysis data
  • Applications of the phylogenetic Analysis.

Services

  • Study nature
  • Nature is a gift
  • A second spring
  • Smiles of nature
  • Just let it rain

Contact

Proin gravida nibh auctor aliquet amet anean sollicitudin, lorem quis.

  • 12 Avenue, New York, NY 10160
  • +1 910-626-85255
  • contact@nature.com
  • Home
  • Statistics
  • Phylogenetics
  • Microbiology
  • Plant Breeding
  • Horticulture
  • Molecular Biology
  • Environment science

Copyright © 2026 Learn Plant Science.

Theme: Oceanly Green by ScriptsTown