This function visualizes the etiology regression against one continuous covariate, e.g., enrollment date. (NB: dealing with NoA, multiple-pathogen causes, other continuous covariates? also there this function only plots the first slice - so generalization may be useful - give users an option to choose slice s; currently default to the first slice.)
plot_etiology_regression(
DIR_NPLCM,
stratum_bool,
slice = 1,
plot_basis = FALSE,
truth = NULL,
RES_NPLCM = NULL,
do_plot = TRUE,
do_rug = TRUE,
return_metric = TRUE,
plot_ma_dots = FALSE
)A figure of etiology regression curves and some marginal positive rate assessment of model fit; See example for the legends.
File path to the folder containing posterior samples
a vector of TRUE/FALSE with TRUE indicating the rows of subjects to include
integer; specifies which slice of bronze-standard data to visualize; Default to 1.
TRUE for plotting basis functions; Default to FALSE
a list of truths computed from true parameters in simulations; elements:
Eti, FPR, PR_case,TPR; All default to NULL in real data analyses.
Currently only works for one slice of bronze-standard measurements (in a non-nested model).
Eti matrix of # of rows = # of subjects, # columns: length(cause_list) for Eti
FPR matrix of # of rows = # of subjects, # columns: ncol(data_nplcm$Mobs$MBS$MBS1)
PR_case matrix of # of rows = # of subjects, # columns: ncol(data_nplcm$Mobs$MBS$MBS1)
TPR a vector of length identical to PR_case
pre-read res_nplcm; default to NULL.
TRUE for plotting
TRUE for plotting
TRUE for showing overall mean etiology, quantiles, s.d., and if truth$Eti is supplied,
coverage, bias, truth and integrated mean squared errors (IMSE).
plot moving averages among case and controls if TRUE; Default to FALSE.
See example figures
A Figure using simulated data for six pathogens: https://github.com/zhenkewu/baker/blob/master/inst/figs/visualize_etiology_regression_SITE=1.pdf
The legends for the figure above: https://github.com/zhenkewu/baker/blob/master/inst/figs/legends_visualize_etiology_regression.png
Other visualization functions:
plot.nplcm(),
plot_BrS_panel(),
plot_SS_panel(),
plot_check_common_pattern(),
plot_check_pairwise_SLORD(),
plot_etiology_strat(),
plot_panels(),
plot_pie_panel(),
plot_subwt_regression()