View source: R/tables_of_coefficients.R
tab_coefs | R Documentation |
This pulls out a table of the coefficients of the models. Confidence intervals are calculated using 'confint'. The function may fail for logistic regression if the MASS package is not installed.
tab_coefs( scale_type = "lp", level = 0.95, type = NULL, outcome = NULL, covariates = NULL, follow_up_time = NULL, event = NULL, data, comp_labels, rounded_zeroes = TRUE, det_limit = NULL )
scale_type |
Can take value "lp" (linear predictors) or "exp" (exponentiated- relevant for interpretation of logistic and Cox models). |
level |
The level argument of the confidence intervals. Passed directly to 'stats::confint'. |
type |
Type of statistical model to use. It should be one of "linear", "logistic", "cox". |
outcome |
Column name of outcome variable in data. If |
covariates |
Character vector of column names of covariates to adjust models for. As this is used as a character vector, special arguments to the standard models (like |
follow_up_time |
Only used if |
event |
Only used if |
data |
Dataset to use for modelling. |
comp_labels |
The labels of the compositional columns. |
rounded_zeroes |
Are zeroes rounded zeroes? |
det_limit |
Detection limit if zeroes are to be imputed. This is needed when |
Table of all model coefficients (parameter value with lower and upper confidence interval of the 95
tab_coefs(scale_type = "lp", # This argument can be "lp" or "exp" and determines whether # coefficients are presented on the scale of the linear predictors ("lp") # or are exponentiated ("exp"). Exponentiation gives the Odds Ratio for # logistic regression models and the Hazard Ratio for Cox regression models. level = 0.95, type = "linear", outcome = "BMI", covariates = c("agegroup", "sex"), data = simdata, comp_labels = c("vigorous", "moderate", "light", "sedentary", "sleep" ), rounded_zeroes = FALSE )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.