plot_exposure_means_bytime: Plot Exposure Model Summaries

Description Usage Arguments Details

View source: R/functions_exposure_model.R

Description

Different plots of the concentrations modelled in the exposure model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
plot_exposure_means_bytime(
  stanfit,
  standata,
  include_time = TRUE,
  include_reI = TRUE,
  exp_transform = FALSE,
  group_names = paste0("Group ", 1:standata$G)
)

plot_exposure_means_boxplot(
  stanfit,
  standata,
  include_time = TRUE,
  include_reI = TRUE,
  exp_transform = FALSE,
  one_per_person = !include_time,
  group_names = paste0("Group ", 1:standata$G)
)

Arguments

stanfit

Fitted STAN model object containing posterior samples of parameters; from sample_exposure_model.

standata

List containing model structure information corresponding to stanfit. Typically a list of class standata_exposure. However, it may be any list (or data frame) containing cluster_of_obs (if etaK was sampled in stanfit), group_of_obs (if etaK was not sampled in stanfit), unit_of_obs (if include_reI=TRUE), and Mt (if include_time=TRUE). This may be useful when calculating fitted means for records at different times from the observations used to fit the model.

include_time

Logical indicator of whether time should be included.

include_reI

Logical indicator of whether the unit-level random effect should be included.

exp_transform

Logical indicator of whether concentrations should be exponentiated.

group_names

Names of groups to use in plot labels

one_per_person

Logical indicator of whether a single observation per unit should be included. If FALSE (the default), then all observations are included in the boxplot. Setting to TRUE is most useful when include_time=FALSE and there is no group crossover, in which case all fitted posterior means for a single unit are the same.

Details

Uses ggplot to create plots of concentrations using posterior means of model parameters. The graphical object is returned and can be customized if needed.

Both functions are wrappers around compute_fitted_mean() and first call that function to compute the posterior mean for each observation.


jpkeller/bercs documentation built on March 24, 2021, 5:36 a.m.