plot_etiology_regression: visualize the etiology regression with a continuous covariate

Description Usage Arguments Value References See Also Examples

View source: R/plot-etiology-regression.R

Description

This function visualizes the etiology regression against one continuous covariates, e.g., enrollment date. (NB: dealing with NoA, multiple-pathogen causes, other continuous covariates?)

Usage

1
2
plot_etiology_regression(DIR_NPLCM, stratum_bool, plot_basis = FALSE,
  truth = NULL)

Arguments

DIR_NPLCM

File path to the folder containing posterior samples

stratum_bool

a vector of TRUE/FALSE with TRUE indicating the rows of subjects to include

plot_basis

TRUE for plotting basis functions; Default to FALSE

truth

a list of truths computed from true parameters in simulations; elements: Eti, FPR, PR which are matrices of # of rows = # of subjects, # columns: length(cause_list) for Eti and ncol(data_nplcm$Mobs$MBS$MBS1); Default to NULL for real data analyses.

Value

A figure of etiology regression curves and some marginal positive rate assessment of model fit; See example for the legends.

References

See example figures: https://github.com/zhenkewu/baker/blob/master/inst/figs/visualize_etiology_regression_SITE=1.pdf and its legends: https://github.com/zhenkewu/baker/blob/master/inst/figs/legends_visualize_etiology_regression.png

See Also

Other visualization functions: plot_BrS_panel, plot_SS_panel, plot_check_common_pattern, plot_check_pairwise_SLORD, plot_etiology_side_by_side, plot_etiology_strat, plot_group_etiology, plot_panels, plot_pie_panel, plot_selected_etiology

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
# legend.text = c("[UPPER FIGURES]",
                "observed prevalence: cases",
                "observed prevalence: controls",
                "fitted prevalence: cases",
                "fitted prevalence: controls",
                "true positive rate: mean",
                "true positive rate: 95%CI",
                "[BOTTOM FIGURES]",
                "etiology curve: mean",
                "overall etiology: mean",
                "overall etiology: 95%CI","","","")
legend.col=c("white","black","dodgerblue2","black","dodgerblue2","red","red",
             "white","springgreen4","orange","orange","white","white","white")
legend.lty=c(1,2,2,1,1,1,2,1,1,1,2)
legend.lwd=c(2,2,2,2,2,2,2,2,2,2,2,2,2,2)
legend("topleft",legend=legend.text,
       lty=legend.lty,lwd=legend.lwd,
       col=legend.col,ncol=2,
       y.intersp=1.5,cex=1.6,box.col=NA)
       
## End(Not run)

oslerinhealth-releases/baker documentation built on Nov. 4, 2019, 11:11 p.m.