| define_missingness | R Documentation |
Records the rule that decides whether one variable is missing for a row. The rule is a formula evaluated row by row against the data, so missingness may depend on any column: on a fully observed covariate, which is MAR, or on the variable's own value, which is MNAR.
define_missingness(
variable,
formula,
link = c("identity", "logit"),
baseline = FALSE,
monotone = FALSE
)
variable |
Variable that may be missing. A single non-empty string. |
formula |
Missingness formula, given as a number, a string, or an unquoted expression over the data columns. It is read as a probability under the identity link and as log odds under the logit link. It is stored as text and evaluated row by row. |
link |
Scale the formula is stated on, one of |
baseline |
Replace every period's draw for a unit with its first
period's draw, so the unit is either always or never missing. A single
flag, defaulting to |
monotone |
Once missing, remain missing at every later period. A single
flag, defaulting to |
A one-row simulab_missing_spec base data.frame with the character
columns variable, formula and link and the logical columns baseline
and monotone.
define_missingness("outcome", formula = "0.2")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.