| add_model | R Documentation |
The regression output comes from stats::lm.
The effect sizes are calculated by heplots::etasq.
The variance inflation is calculated by car::vif.
add_model(
data,
col,
categorical,
metric,
interactions = NULL,
labels = TRUE,
clean = TRUE,
...
)
data |
A tibble. |
col |
The target column holding metric values. |
categorical |
A tidy column selection holding categorical variables. |
metric |
A tidy column selection holding metric variables. |
interactions |
A vector of interaction effects to calculate.
Each interaction effect should be provided as multiplication of the variables.
The interaction effect can be provided as character value (e.g. |
labels |
If TRUE (default) extracts labels from the attributes, see codebook. |
clean |
Prepare data by data_clean. |
... |
Placeholder to allow calling the method with unused parameters from effect_metrics. |
The input tibble with one additional column. The new column name is derived from the target column, prefixed with "prd_". The new column will have an attribute "lm.fit" with the fit model.
library(volker)
data <- filter(volker::chatgpt, sd_gender != "diverse")
data <- data |>
add_model(use_work, categorical = c(sd_gender, adopter), metric = sd_age)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.