library(car)
library(dae)
library(dplyr)
library(emmeans)
library(ggplot2)
library(lmerTest)
library(magrittr)
library(predictmeans)
data(DataExam8.1)
# Pg. 141
fm8.4 <-
aov(
formula = dbh ~ inoc + Error(repl/inoc) +
inoc*country*prov
, data = DataExam8.1
)
# Pg. 150
summary(fm8.4)
# Pg. 150
model.tables(x = fm8.4, type = "means")
RESFit <-
data.frame(
fittedvalue = fitted.aovlist(fm8.4)
, residualvalue = proj(fm8.4)$Within[,"Residuals"]
)
ggplot(
data = RESFit
, mapping = aes(x = fittedvalue, y = residualvalue)
) +
geom_point(size = 2) +
labs(
x = "Residuals vs Fitted Values"
, y = ""
) +
theme_bw()
# Pg. 153
fm8.6 <-
aov(
formula = terms(
dbh ~ inoc + repl + col +
repl:row + repl:col +
prov + inoc:prov
, keep.order = TRUE
)
, data = DataExam8.1
)
summary(fm8.6)
Run the code above in your browser using DataLab