extract_nps_mh: Extract medical history without perfect separation

Description Usage Arguments Value Examples

View source: R/extract_nps_mh-function.R

Description

This function makes a list of medical histories without perfect separation. This means a medical history per outcome have non-zero variance.

Usage

1
extract_nps_mh(tidy_set, sd_cutoff = 0)

Arguments

tidy_set

A TidySet (i.e. ExpressionSet) containing the visits of subjects in outcome dataset, paid by any payment systems. This TidySet also accomodates outcome dataset. This is an output of compile_mh_outcome().

sd_cutoff

Cutoff of standard deviation, a non-negative numeric that is used for cutoff. If standard deviation of a medical history metric for an outcome is more than the cutoff for that outcome, either non-event or event, then that medical history is accounted to the list.

Value

Medical history list, a data frame with rows for unique medical history and columns of key, nonevent and event. The last two columns are standard deviation of the medical history for non-event and event. Missing value or NA is not accounted when computing the standard deviation.

Examples

1
2
3
4
5
## Create input example
data(medhistdata)

## Extract medical history without perfect separation
ps_remover=extract_nps_mh(medhistdata)

herdiantrisufriyana/medhist documentation built on June 24, 2021, 3:41 a.m.