View source: R/imputation_rule.R
imputation_rule | R Documentation |
imputation_rule(
df,
x_stats,
stat,
imp_rule,
post = FALSE,
avalcat_var = "AVALCAT1"
)
df |
( |
x_stats |
(named |
stat |
( |
imp_rule |
( |
post |
( |
avalcat_var |
( |
A list
containing statistic value (val
) and NA level (na_str
) that should be displayed
according to the specified imputation rule.
analyze_vars_in_cols()
where this function can be implemented by setting the imp_rule
argument.
set.seed(1)
df <- data.frame(
AVAL = runif(50, 0, 1),
AVALCAT1 = sample(c(1, "BLQ"), 50, replace = TRUE)
)
x_stats <- s_summary(df$AVAL)
imputation_rule(df, x_stats, "max", "1/3")
imputation_rule(df, x_stats, "geom_mean", "1/3")
imputation_rule(df, x_stats, "mean", "1/2")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.