dependent_label | R Documentation |
Can be add dependent label to final results dataframe.
dependent_label(df.out, .data, dependent, prefix = "Dependent: ", suffix = "")
df.out |
Dataframe (results table) to be altered. |
.data |
Original dataframe. |
dependent |
Character vector of length 1: quoted name of depdendent
variable. Can be continuous, a binary factor, or a survival object of form
|
prefix |
Prefix for dependent label |
suffix |
Suffix for dependent label |
Returns the label for the dependent variable, if specified.
library(dplyr)
explanatory = c("age.factor", "sex.factor", "obstruct.factor", "perfor.factor")
explanatory_multi = c("age.factor", "obstruct.factor")
random_effect = "hospital"
dependent = 'mort_5yr'
# Separate tables
colon_s %>%
summary_factorlist(dependent, explanatory, fit_id=TRUE) -> example.summary
colon_s %>%
glmuni(dependent, explanatory) %>%
fit2df(estimate_suffix=" (univariable)") -> example.univariable
colon_s %>%
glmmulti(dependent, explanatory) %>%
fit2df(estimate_suffix=" (multivariable)") -> example.multivariable
colon_s %>%
glmmixed(dependent, explanatory, random_effect) %>%
fit2df(estimate_suffix=" (multilevel") -> example.multilevel
# Pipe together
example.summary %>%
finalfit_merge(example.univariable) %>%
finalfit_merge(example.multivariable) %>%
finalfit_merge(example.multilevel) %>%
select(-c(fit_id, index)) %>%
dependent_label(colon_s, dependent) -> example.final
example.final
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.