deconstruct_formula {basecamb} | R Documentation |
Deconstruct formula
Description
Deconstruct a formula object into strings of its components. Predictors are split by '+', so interaction terms will be returned as a single string.
Usage
deconstruct_formula(formula)
Arguments
formula |
formula object for use in statistical models. |
Value
a named list with fields:
outcome (character)
predictors (vector of characters)
censor_event (character) (optional) censor event, only for formulas including a Surv() object
Author(s)
J. Peter Marquardt
Examples
deconstruct_formula(stats::as.formula("outcome ~ predictor1 + predictor2 + predictor3"))
deconstruct_formula(stats::as.formula("Surv(outcome, censor_event) ~ predictor"))
[Package basecamb version 1.1.5 Index]