comp_model | R Documentation |
This is a wrapper for lm
, glm
and survival::coxph
which performs the compositional transformation before generating the model.
comp_model( type = NULL, outcome = NULL, covariates = NULL, comp_labels, data, follow_up_time = NULL, event = NULL, rounded_zeroes = TRUE, det_limit = NULL, part_1 = NULL )
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 |
comp_labels |
The labels of the compositional columns. |
data |
Dataset to use for modelling. |
follow_up_time |
Only used if |
event |
Only used if |
rounded_zeroes |
Are zeroes rounded zeroes? |
det_limit |
Detection limit if zeroes are to be imputed. This is needed when |
part_1 |
Used with ilr-pivot coordinate transformation to specify which should be first part. Passed to |
Model using a compositional exposure variable (lm
, glm
or coxph
object as appropriate).
comp_model(type = "linear", outcome = "BMI", covariates = c("agegroup", "sex"), comp_labels = c("vigorous", "moderate", "light", "sedentary", "sleep"), data = simdata, det_limit = 0.00119)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.