Example 8.1.2 from Experimental Design & Analysis for Tree Improvement
Source:R/Exam8.1.2.R
Exam8.1.2.Rd
Exam8.1.2 presents the Analysis of Nested Seedlot Structure of Diameter at breast height (Dbh) of 60 SeedLots under layout of row column design with 6 rows and 10 columns in 18 countries and 59 provinces of 18 selected countries given in Example 8.1.
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(DataExam8.1)
# Pg. 167
fm8.11 <-
aov(
formula = dbh ~ country + country:prov
, data = DataExam8.1
)
b <- anova(fm8.11)
Res <- length(b[["Sum Sq"]])
df <- 119
MSS <- 0.1951
b[["Df"]][Res] <- df
b[["Sum Sq"]][Res] <- MSS*df
b[["Mean Sq"]][Res] <- b[["Sum Sq"]][Res]/b[["Df"]][Res]
b[["F value"]][1:Res-1] <-
b[["Mean Sq"]][1:Res-1]/b[["Mean Sq"]][Res]
b[["Pr(>F)"]][Res-1] <-
df(
b[["F value"]][Res-1]
, b[["Df"]][Res-1]
, b[["Df"]][Res]
)
b
#> Analysis of Variance Table
#>
#> Response: dbh
#> Df Sum Sq Mean Sq F value Pr(>F)
#> country 17 54.619 3.2129 16.468 0.00000001235 ***
#> country:prov 41 18.606 0.4538 2.326 0.001502 **
#> Residuals 119 23.217 0.1951
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
emmeans(fm8.11, specs = "country")
#> NOTE: A nesting structure was detected in the fitted model:
#> prov %in% country
#> NOTE: Results may be misleading due to involvement in interactions
#> country emmean SE df lower.CL upper.CL
#> India 3.57 0.165 177 3.25 3.90
#> Vietnam 3.28 0.181 177 2.92 3.63
#> Egypt 2.50 0.233 177 2.04 2.96
#> Kenya 3.49 0.143 177 3.21 3.77
#> Fiji 2.61 0.233 177 2.15 3.07
#> Thailand 3.84 0.202 177 3.44 4.24
#> Malaysia 4.03 0.135 177 3.77 4.30
#> Philippines 3.61 0.233 177 3.15 4.07
#> Australia 2.63 0.202 177 2.23 3.03
#> PNG 3.65 0.404 177 2.85 4.45
#> Solomon Is. 3.70 0.285 177 3.14 4.26
#> Mauritius 3.12 0.404 177 2.33 3.92
#> Sri Lanka 3.24 0.233 177 2.78 3.70
#> Guam 2.34 0.404 177 1.55 3.14
#> China 3.69 0.233 177 3.23 4.15
#> Puerto Rico 3.35 0.404 177 2.55 4.14
#> Vanuatu 2.76 0.404 177 1.97 3.56
#> Benin 3.34 0.404 177 2.55 4.14
#>
#> Results are averaged over the levels of: prov
#> Confidence level used: 0.95