plot_cough_rate_error: Plot cough rate error as a function of monitoring time.

Description Usage Arguments Value

View source: R/plot_cough_rate_error.R

Description

How much monitoring is enough to estimate the overall cough rate accurately? This is a difficult question to answer, but this plot can help approximate it. It shows the cough rate estimate based on 1 hour of monitoring, 2 hours, 3 hours, ..., up until the entire cough record. The plot also displays the 'overall' cough rate, using the entire monitoring record, and horizontal lines indicating a range of acceptable error around the 'true' rate.

Usage

1
plot_cough_rate_error(hours, cutoff = 0.5, min_error = 0.1, toplot = TRUE)

Arguments

hours

A dataframe of hourly cough counts. Minimum requirements: A column coughs with coughs counted in each hour, and a column rec with monitoring time during that hour (0 - 1). For example, you can use ho$hours (from a hyfe object) or the output of simulate_cough_rate().

cutoff

The amount of monitoring within an hour in order for that hour to be included in cough rate calculations. Default is 0.5 (half hour of monitoring during the hour).

min_error

Minimum acceptable error. Default is 10% (0.1).

toplot

If TRUE (the default), a plot will dispaly the result.

Value

The hours dataframe with additional columns: estimate, the cough rate estimate up to that hour of monitoring; error, the error in that estimate based upon the overall cough rate; prop_error, the proportional error.


hyfe-ai/hyfer documentation built on Dec. 20, 2021, 5:53 p.m.