reveal_model_warnings {multitool} | R Documentation |
Reveal any warnings about your models during a multiverse analysis
Description
Reveal any warnings about your models during a multiverse analysis
Usage
reveal_model_warnings(.multi, .unpack_specs = "no")
Arguments
.multi |
a multiverse list-column |
.unpack_specs |
character, options are |
Value
the unnested model warnings captured during analysis
Examples
library(tidyverse)
library(multitool)
# Simulate some data
the_data <-
data.frame(
id = 1:500,
iv1 = rnorm(500),
iv2 = rnorm(500),
iv3 = rnorm(500),
mod1 = rnorm(500),
mod2 = rnorm(500),
mod3 = rnorm(500),
cov1 = rnorm(500),
cov2 = rnorm(500),
dv1 = rnorm(500),
dv2 = rnorm(500),
include1 = rbinom(500, size = 1, prob = .1),
include2 = sample(1:3, size = 500, replace = TRUE),
include3 = rnorm(500)
)
# Decision pipeline
full_pipeline <-
the_data |>
add_filters(include1 == 0,include2 != 3,include2 != 2,scale(include3) > -2.5) |>
add_variables("ivs", iv1, iv2, iv3) |>
add_variables("dvs", dv1, dv2) |>
add_variables("mods", starts_with("mod")) |>
add_model("linear_model", lm({dvs} ~ {ivs} * {mods} + cov1))
pipeline_grid <- expand_decisions(full_pipeline)
# Run the whole multiverse
the_multiverse <- run_multiverse(pipeline_grid[1:10,])
# Reveal results of the linear model
the_multiverse |>
reveal_model_warnings()
[Package multitool version 0.1.4 Index]