2  Experimental Planning and Layout

2.1 Example 2.1 (Pg. 24)

Example 2.1 (Pg. 24)

A field trial was planted to compare a seedlot derived from a seed orchard (SO) with one collected from a routine plantation (P). There were eight plots of each seedlot, thinned at seven years of age. Tree diameters at breast height (dbh) were measured at 15 years and plot means calculated.


 library(car)

 library(dae)

 library(dplyr)

 library(emmeans)

 library(ggplot2)

 library(lmerTest)

 library(magrittr)

 library(predictmeans)

 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

 # 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()

2.2 Example 2.2 (Pg. 26)

Example 2.2 (Pg. 26)

 library(car)

 library(dae)

 library(dplyr)

 library(emmeans)

 library(ggplot2)

 library(lmerTest)

 library(magrittr)

 library(predictmeans)

 data(DataExam2.2)

 # Pg. 24
 fmtab2.5 <-
           lm(
              formula  = dbh ~ block + seedlot
            , data     = DataExam2.2
            )

 # Pg. 26
 anova(fmtab2.5)
Analysis of Variance Table

Response: dbh
          Df Sum Sq Mean Sq F value  Pr(>F)  
block      7 48.867  6.9810  3.8959 0.04671 *
seedlot    1 14.270 14.2695  7.9635 0.02570 *
Residuals  7 12.543  1.7919                  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

 # Pg. 26
 emmeans(object = fmtab2.5, specs = ~ seedlot)
 seedlot emmean    SE df lower.CL upper.CL
 SO        30.6 0.473  7     29.5     31.7
 P         28.7 0.473  7     27.6     29.8

Results are averaged over the levels of: block 
Confidence level used: 0.95 

 emmip(object = fmtab2.5, formula = ~ seedlot) +
   theme_classic()