get_dataset_from_model: Extract dataset from model object

View source: R/extract_model_properties.R

get_dataset_from_modelR Documentation

Extract dataset from model object

Description

Used by predict_fit_and_ci and plot_transfers.

Usage

get_dataset_from_model(model, comp_labels, transf_labels, type)

Arguments

model

Model to use in estimates/predictions.

comp_labels

The labels of the compositional columns.

transf_labels

Ilr-transformed compositional column labels.

type

Model type.

Value

Dataset used to create model with compositional columns on original scale.

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_dataset_from_model(model = lm_outcome, comp_labels = comp_labels,
                       transf_labels = tl, type = "linear")

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