View source: R/plot_delta_comp.R
| plot_delta_comp | R Documentation |
Provided the data (containing outcome, composiitional compoents and covariates), fit a ilr multiple linear regression model and provide predictions from reallocating compositional values pairwise amunsnst the components model.
plot_delta_comp(dc_obj, comp_total = NULL, units_lab = NULL)
dc_obj |
A |
comp_total |
A numeric scalar that is the original units of the composition to make the x-axis the original scale instead of in the range |
units_lab |
Character string of the units of the compositions relating to |
Ty Stanford <tystan@gmail.com>
data(fairclough)
deltacomp_df <-
predict_delta_comps(
dataf = fairclough,
y = "z_bmi",
comps = c("sleep","sed","lpa","mvpa"),
covars = c("decimal_age","sex"),
deltas = seq(-20, 20, by = 5) / (24 * 60),
comparisons = "prop-realloc",
alpha = 0.05
)
class(deltacomp_df)
plot_delta_comp(
dc_obj = deltacomp_df,
comp_total = 24 * 60,
units_lab = "min"
)
deltacomp_df <-
predict_delta_comps(
dataf = fairclough,
y = "z_bmi",
comps = c("sleep","sed","lpa","mvpa"),
covars = c("decimal_age","sex"),
deltas = seq(-20, 20, by = 5) / (24 * 60),
comparisons = "one-v-one",
alpha = 0.05
)
plot_delta_comp(
dc_obj = deltacomp_df,
comp_total = 24 * 60,
units_lab = "min"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.