plot_delta_comp function

Plot redistributed time-use predictions from compositional ilr multiple linear regression model fit

Plot redistributed time-use predictions from compositional ilr multiple linear regression model fit

Plot redistributed time-use predictions from compositional ilr multiple linear regression model fit by predict_delta_comps()

plot_delta_comp(dc_obj, comp_total = NULL, units_lab = NULL)

Arguments

  • dc_obj: A deltacomp_obj object returned from the function predict_delta_comps
  • 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 [min(delta), max(delta)] in (-1, 1).
  • units_lab: Character string of the units of the compositions relating to comp_total to add to the x-axis label

Returns

Returns a plot object from the ggplot2 package (that is, class of gg and ggplot).

Examples

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" )

Author(s)

Ty Stanford tystan@gmail.com