Exam4.3: Example 4.3 from Experimental Design and Analysis for Tree...

Exam4.3R Documentation

Example 4.3 from Experimental Design and Analysis for Tree Improvement

Description

Exam4.3 presents the germination count data for 4 Pre-Treatments and 6 Seedlots.

Author(s)

  1. Muhammad Yaseen (myaseen208@gmail.com)

  2. Sami Ullah (samiullahuos@gmail.com)

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

DataExam4.3

Examples

library(car)
library(dae)
library(dplyr)
library(emmeans)
library(ggplot2)
library(lmerTest)
library(magrittr)
library(predictmeans)

data(DataExam4.3)

 # Pg. 50
 fm4.2    <-
   aov(
       formula =
       percent ~ repl + contcomp + seedlot +
                 treat/contcomp + contcomp/seedlot +
                 treat/contcomp/seedlot
      , data   = DataExam4.3
     )

 # Pg. 54
 anova(fm4.2)

 # Pg. 54
 model.tables(x = fm4.2, type = "means")

 emmeans(object = fm4.2, specs = ~ contcomp)
 emmeans(object = fm4.2, specs = ~ seedlot)
 emmeans(object = fm4.2, specs = ~ contcomp + treat)
 emmeans(object = fm4.2, specs = ~ contcomp + seedlot)
 emmeans(object = fm4.2, specs = ~ contcomp + treat + seedlot)

 DataExam4.3 %>%
   dplyr::group_by(treat, contcomp, seedlot) %>%
   dplyr::summarize(Mean = mean(percent))
   RESFIT <-
          data.frame(
           residualvalue = residuals(fm4.2)
         , fittedvalue   = fitted.values(fm4.2)
         )

   ggplot(mapping = aes(
                         x = fitted.values(fm4.2)
                       , y = residuals(fm4.2))) +
   geom_point(size = 2) +
   labs(
       x = "Fitted Values"
     , y = "Residuals"
     ) +
     theme_classic()


MYaseen208/eda4treeR documentation built on Sept. 15, 2024, 10:56 a.m.