Skip to contents

visualize trend of pathogen observation rate for NPPCR data (both cases and controls)

Usage

visualize_season(data_nplcm, patho, slice = 1, slice_SS = 1)

Arguments

data_nplcm

Data set produced by clean_perch_data()

patho

the index of pathogen

slice

the slice of BrS data for visualization; default is 1.

slice_SS

the slice of SS data to add onto BrS plots; default is 1, usually representing blood culture measurements.

Value

A figure with smoothed positive rate and confidence bands for cases and controls, respectively. The right margin shows marginal positive rates; all rates are only among the subset of case subjects who had non-missing responses for a measured agent (e.g., pathogen); similarly for controls.

Details

This function shows observed positive rate for continuous covariates,e.g., enrollment date in PERCH application. Smoothing is done by penalized splines implemented by mgcv package. The penalized spline smoothing term is constructed by mgcv::smooth.construct.ps.smooth.spec(). The window size of the moving averages currently is set to 60 days.

See also

Other exploratory data analysis functions: get_top_pattern(), plot_logORmat(), show_individual(), summarize_BrS(), summarize_SS()