get_cm_from_model: Extract compositional mean from model object

View source: R/extract_model_properties.R

get_cm_from_modelR Documentation

Extract compositional mean from model object

Description

Used by predict_fit_and_ci and plot_transfers.

Usage

get_cm_from_model(model, comp_labels, transf_labels)

Arguments

model

Model to use in estimates/predictions.

comp_labels

The labels of the compositional columns.

transf_labels

Ilr-transformed compositional column labels.

Value

Compositional mean of data used to create models, on both original and transformed scale (two element list).

Examples

lm_outcome <- comp_model(
type = "linear",
outcome = "BMI",
covariates = c("agegroup", "sex"),
data = simdata,
comp_labels = c("vigorous", "moderate", "light", "sedentary", "sleep"),
det_limit = 0.00119
)

comp_labels <- c("vigorous", "moderate", "light", "sedentary", "sleep")
tl <- transf_labels(comp_labels = comp_labels, transformation_type = "ilr")
get_cm_from_model(model = lm_outcome, comp_labels = comp_labels,
transf_labels = tl)

OxWearables/epicoda documentation built on Dec. 7, 2022, 9:07 p.m.