Exam2.1 is used to compare two seed lots by using single factor ANOVA.

References

  1. E.R. Williams, C.E. Harwood and A.C. Matheson (2023). Experimental Design and Analysis for Tree Improvement. CSIRO Publishing (https://www.publish.csiro.au/book/3145/).

See also

Author

  1. Muhammad Yaseen (myaseen208@gmail.com)

  2. Sami Ullah (samiullahuos@gmail.com)

Examples

library(car)
#> Loading required package: carData
library(dae)
#> Loading required package: ggplot2
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following object is masked from 'package:car':
#> 
#>     recode
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(emmeans)
library(ggplot2)
library(lmerTest)
#> Loading required package: lme4
#> Loading required package: Matrix
#> 
#> Attaching package: 'lmerTest'
#> The following object is masked from 'package:lme4':
#> 
#>     lmer
#> The following object is masked from 'package:stats':
#> 
#>     step
library(magrittr)
library(predictmeans)
#> Loading required package: nlme
#> 
#> Attaching package: 'nlme'
#> The following object is masked from 'package:lme4':
#> 
#>     lmList
#> The following object is masked from 'package:dplyr':
#> 
#>     collapse
library(supernova)

data(DataExam2.1)
# Pg. 22
fmtab2.3  <- lm(formula = dbh ~ SeedLot, data = DataExam2.1)
# Pg. 23
anova(fmtab2.3)
#> Analysis of Variance Table
#> 
#> Response: dbh
#>           Df Sum Sq Mean Sq F value  Pr(>F)  
#> SeedLot    1  14.27 14.2695  3.2531 0.09284 .
#> Residuals 14  61.41  4.3864                  
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
supernova(fmtab2.3, type = 1)
#>  Analysis of Variance Table (Type I SS)
#>  Model: dbh ~ SeedLot
#> 
#>                              SS df     MS     F   PRE     p
#>  ----- --------------- | ------ -- ------ ----- ----- -----
#>  Model (error reduced) | 14.270  1 14.270 3.253 .1886 .0928
#>  Error (from model)    | 61.410 14  4.386                  
#>  ----- --------------- | ------ -- ------ ----- ----- -----
#>  Total (empty model)   | 75.679 15  5.045                  

# Pg. 23
emmeans(object = fmtab2.3, specs = ~ SeedLot)
#>  SeedLot emmean   SE df lower.CL upper.CL
#>  SO        30.6 0.74 14     29.0     32.2
#>  P         28.7 0.74 14     27.1     30.3
#> 
#> Confidence level used: 0.95 
emmip(object = fmtab2.3, formula = ~ SeedLot) +
  theme_classic()