cough_rate_distribution: Cough rate distribution

Description Usage Arguments Details Value

View source: R/cough_rate_distribution.R

Description

Summarize cough rates and retrieve hourly cough counts for use in histogram-production and cough distribution modeling.

Usage

1
cough_rate_distribution(ho, min_session = 0.5)

Arguments

ho

A hyfe object, which is generated by process_hyfe_data(). See full details and examples in the package vignette.

min_session

allows you to define the minimum amount of monitoring required during a single hour in order for that hour to be included in the cough rate estimation. For example, sometimes an hour of day contains only a few minutes of monitoring for a user; that makes for a pretty poor estimate of that hour’s cough rate. The default min_session is 0.5 hours, or 30 minutes of monitoring within an hour.

Details

This function can take both aggregated data (ho) and user-separated (ho_by_user), but it does best with the latter. It returns metrics about hourly cough rates based on an hour-by-hour analysis. Similar to the inputs in hyfe_summarize(), the argument min_session The slot $details returns a dataframe with all details you might need to analyze these rates (essentially the hours table from a hyfe object).

Value

A list with named slots: overall contains a dataframe with the mean and SD of hourly cough rate for the entire dataset. These metrics are based on the mean/variance for each individual user, i.e., mean_of_mean is the average of mean cough rates across users. When using a hyfe object prepared with by_user=TRUE, this means that each user is weighted equally in the summary statistics. When using a hyfe object in which all user data are aggregated together, users will be weighted according to their session time; The slot $users contains a dataframe with the mean and SD cough rate for each user. The slot $rates returns a numeric vector of hourly cough rates that satisfy the minimum monitoring threshold:


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