Closed jepusto closed 2 years ago
The following example returns incorrect results because the model specification includes a random effect expressed as I(session^1):
I(session^1)
# Load packages library(nlme) library(scdhlm) # Load data data(AlberMorgan) dat <- AlberMorgan # Clean data dat <- dat[,c("case", "session", "condition", "outcome")] names(dat) <- c("case","session","phase","outcome") dat <- preprocess_SCD(case = case, phase = phase, session = session, outcome = outcome, design = "MB", center = 5, data = dat) # Fit the model fit_RML <- lme(fixed = outcome ~ 1 + I(session^1) + trt, random = ~ 1 + I(session^1) | case, correlation = corAR1(0.01, ~ session | case), data = dat, control = lmeControl(msMaxIter = 50, apVar = FALSE, returnObject = TRUE)) summary(fit_RML) extract_varcomp(fit_RML)
The following example returns incorrect results because the model specification includes a random effect expressed as
I(session^1)
: