d <- ex31
d$cell <- interaction(d$drug, d$dose, drop = TRUE)
fm <-
vlm_fit(
fixed = PCV2 ~ drug + drug:dose
, data = ex31
, random = ~ drug:herd
, repeated = NULL
, method = c("REML", "ML", "Type3")
, ddfm = "satterth"
, type = 3
, class = c("herd", "dose")
, bound = TRUE
, control = list()
)
lt <- lmerTest::lmer(formula = PCV2 ~ 0 + cell + (1 | drug:herd), data = d)
ct <- lmerTest::contest(lt, rbind(c(0.5, -1, 0.5)), joint = TRUE)
data.frame(package = c("VetResearchLMM", "lmerTest"), F = c(fm$tests$F[1L], ct[["F value"]]),
den_df = c(fm$tests$den_df[1L], ct[["DenDF"]]))
package F den_df
1 VetResearchLMM 0.001544608 10.08194
2 lmerTest 0.001544636 10.08200
ar <-
vlm_fit(
fixed = PCV ~ breed + breed:time
, data = ex33
, random = NULL
, repeated = vlm_repeated(
type = c("vc", "cs", "ar1", "sp_pow", "un")[4]
, subject = ~ animal_id:breed
, order = ~ time
)
, method = c("REML", "ML", "Type3")
, ddfm = c("default", "contain", "residual", "betwithin", "satterth", "kr")
, type = 3
, class = NULL
, bound = TRUE
, control = list()
)
ex33$sub <- interaction(ex33$animal_id, ex33$breed, drop = TRUE)
g <-
nlme::gls(
model = PCV ~ breed + breed:time
, data = ex33
, correlation = nlme::corExp(form = ~ time | sub)
, method = "REML"
)
c(VetResearchLMM = -ar$fit$value[1L] / 2, nlme = as.numeric(stats::logLik(g)))
VetResearchLMM nlme
-414.6905 -414.6905