
Get coefficients for the random intercepts and random slopes.
get_random(model, cond = NULL, print.summary = getOption("itsadug_print"))
A named list of the values to restrict the estimates for the random predictor terms. When NULL (default) all levels are returned. Only relevant for complex interactions, which involve more than two dimensions.
Logical: whether or not to print a summary of the
values selected for each predictor.
Default set to the print info messages option
(see infoMessages
).
The coefficients of the random intercepts and slopes.
Other Model predictions:
get_coefs()
,
get_difference()
,
get_fitted()
,
get_modelterm()
,
get_predictions()
# NOT RUN {
data(simdat)
# }
# NOT RUN {
# Condition as factor, to have a random intercept
# for illustration purposes:
simdat$Condition <- as.factor(simdat$Condition)
# Model with random effect and interactions:
m2 <- bam(Y ~ s(Time) + s(Trial)
+ ti(Time, Trial)
+ s(Condition, bs='re')
+ s(Time, Subject, bs='re'),
data=simdat)
# extract all random effects combined:
newd <- get_random(m2)
head(newd)
# extract coefficients for the random intercept for Condition:
# Make bar plot:
barplot(newd[[1]])
abline(h=0)
# or select:
get_random(m2, cond=list(Condition=c('2','3')))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab