lm_mverse
fits lm
across the multiverse
according to model specifications provided by formula_branch
.
At least one formula_branch
must have been added.
lm_mverse(.mverse, parallel = FALSE, progress = FALSE)
a mverse
object.
passed to multiverse::execute_multiverse()
to indicate
whether to execute the multiverse analysis in parallel. Defaults to FALSE.
passed to multiverse::execute_multiverse()
to indicate
whether to include a progress bar for each step of the execution. Defaults
to FALSE.
A mverse
object with lm
fitted.
Other model fitting functions:
glm.nb_mverse()
,
glm_mverse()
# \donttest{
# Fitting \code{lm} models fitted across a multiverse.
hurricane_strength <- mutate_branch(
NDAM,
HighestWindSpeed,
Minpressure_Updated_2014
)
y <- mutate_branch(
alldeaths, log(alldeaths + 1)
)
hurricane_outliers <- filter_branch(
!Name %in% c("Katrina", "Audrey", "Andrew"),
TRUE # include all
)
model_specifications <- formula_branch(
y ~ MasFem,
y ~ MasFem + hurricane_strength
)
mv <- create_multiverse(hurricane) %>%
add_filter_branch(hurricane_outliers) %>%
add_mutate_branch(hurricane_strength, y) %>%
add_formula_branch(model_specifications) %>%
lm_mverse()
# }