Example 4.3.1 from Experimental Design and Analysis for Tree Improvement
Source:R/Exam4.3.1.R
Exam4.3.1.Rd
Exam4.3.1 presents the germination count data for 4 Pre-Treatments and 6 Seedlots.
References
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/).
Author
Muhammad Yaseen (myaseen208@gmail.com)
Sami Ullah (samiullahuos@gmail.com)
Examples
library(car)
library(dae)
library(dplyr)
library(emmeans)
library(ggplot2)
library(lmerTest)
library(magrittr)
library(predictmeans)
data(DataExam4.3)
# Pg. 57
fm4.4 <-
aov(
formula = percent ~ repl + treat*seedlot
, data = DataExam4.3 %>%
filter(treat != "control")
)
# Pg. 57
anova(fm4.4)
#> Analysis of Variance Table
#>
#> Response: percent
#> Df Sum Sq Mean Sq F value Pr(>F)
#> repl 2 64.6 32.30 0.2511 0.7793606
#> treat 2 5300.1 2650.07 20.6055 1.375e-06 ***
#> seedlot 5 4148.1 829.63 6.4507 0.0002578 ***
#> treat:seedlot 10 961.2 96.12 0.7474 0.6759614
#> Residuals 34 4372.7 128.61
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
model.tables(x = fm4.4, type = "means", se = TRUE)
#> Tables of means
#> Grand mean
#>
#> 67.85185
#>
#> repl
#> repl
#> 1 2 3
#> 69.11 66.44 68.00
#>
#> treat
#> treat
#> nick bw&s bw1min
#> 56.89 65.78 80.89
#>
#> seedlot
#> seedlot
#> 18211 18212 18217 18248 18249 18265
#> 77.33 69.33 63.11 53.33 64.89 79.11
#>
#> treat:seedlot
#> seedlot
#> treat 18211 18212 18217 18248 18249 18265
#> nick 65.33 54.67 57.33 40.00 49.33 74.67
#> bw&s 78.67 68.00 54.67 52.00 61.33 80.00
#> bw1min 88.00 85.33 77.33 68.00 84.00 82.67
#>
#> Standard errors for differences of means
#> repl treat seedlot treat:seedlot
#> 3.780 3.780 5.346 9.260
#> replic. 18 18 9 3
emmeans(object = fm4.4, specs = ~ treat)
#> NOTE: Results may be misleading due to involvement in interactions
#> treat emmean SE df lower.CL upper.CL
#> nick 56.9 2.67 34 51.5 62.3
#> bw&s 65.8 2.67 34 60.3 71.2
#> bw1min 80.9 2.67 34 75.5 86.3
#>
#> Results are averaged over the levels of: repl, seedlot
#> Confidence level used: 0.95
emmeans(object = fm4.4, specs = ~ seedlot)
#> NOTE: Results may be misleading due to involvement in interactions
#> seedlot emmean SE df lower.CL upper.CL
#> 18211 77.3 3.78 34 69.7 85.0
#> 18212 69.3 3.78 34 61.7 77.0
#> 18217 63.1 3.78 34 55.4 70.8
#> 18248 53.3 3.78 34 45.7 61.0
#> 18249 64.9 3.78 34 57.2 72.6
#> 18265 79.1 3.78 34 71.4 86.8
#>
#> Results are averaged over the levels of: repl, treat
#> Confidence level used: 0.95
emmeans(object = fm4.4, specs = ~ treat * seedlot)
#> treat seedlot emmean SE df lower.CL upper.CL
#> nick 18211 65.3 6.55 34 52.0 78.6
#> bw&s 18211 78.7 6.55 34 65.4 92.0
#> bw1min 18211 88.0 6.55 34 74.7 101.3
#> nick 18212 54.7 6.55 34 41.4 68.0
#> bw&s 18212 68.0 6.55 34 54.7 81.3
#> bw1min 18212 85.3 6.55 34 72.0 98.6
#> nick 18217 57.3 6.55 34 44.0 70.6
#> bw&s 18217 54.7 6.55 34 41.4 68.0
#> bw1min 18217 77.3 6.55 34 64.0 90.6
#> nick 18248 40.0 6.55 34 26.7 53.3
#> bw&s 18248 52.0 6.55 34 38.7 65.3
#> bw1min 18248 68.0 6.55 34 54.7 81.3
#> nick 18249 49.3 6.55 34 36.0 62.6
#> bw&s 18249 61.3 6.55 34 48.0 74.6
#> bw1min 18249 84.0 6.55 34 70.7 97.3
#> nick 18265 74.7 6.55 34 61.4 88.0
#> bw&s 18265 80.0 6.55 34 66.7 93.3
#> bw1min 18265 82.7 6.55 34 69.4 96.0
#>
#> Results are averaged over the levels of: repl
#> Confidence level used: 0.95