I'm looking to illustrate an effect using area under the curve (AUC) in r. Specifically, I need to illustrate the AUC with respect to increase from baseline over 5 days.
I'm looking at biological data where the outcome is not coded as 0,1 but rather as continuous over time. I'm interested in creating this graph described in Fekedulegn et al., 2007 (https://www.ncbi.nlm.nih.gov/pubmed/17766693) with my own data.
I've seen several wonderful packages for AUC so far, but none to compute the AUC with respect to increase from baseline with the exception of one answer, described here: Incremental Area Under the Curve (iAUC) in R). This didn't quite work for my problem though.
The variables are as follows in a long-form dataset:
Baseline: total # of predictive biomarker produced when assessed at baseline
Panel_value: total # of predictive biomarker produced over 5 days (continuous)
Reap: frequency of cognitive reappraisal (continuous), but needed to bin this variable
Reap.quantiles: mutated reappraisal variables to plot values for each quantile
Reap.hilo: mutated reappraisal variable to plot values for those at top and bottom quantile for the frequency of cognitive reappraisal
Day: day of infection
I would greatly appreciate it if anyone can provide insight on any packages to compute AUC with respect to increase from baseline or recommend any alternative methods - bonus points if I can do it in ggplot as plotted here! Thanks in advance!