trans_hist_rate: Transform medical history into a rate by utilizing...

Description Usage Arguments Value Examples

View source: R/trans_hist_rate-function.R

Description

This function transforms each medical history from day interval to a rate by utilizing Kaplan-Meier estimator in time-to-event analysis. Intuition behind this procedure is that a medical history may be absent because a patient do not visit a healthcare provider although there is a symptom indicating a medical condition. Another situation is a patient visit another provider; thus, a healthcare provider do not have record of a medical history, while the patient do not report (e.g. forget) that medical history to the physician. Therefore, the transformed value is the probability of a code not encountered before t that denotes a time when at least a code encountered once. A censored code encounter is treated as 'not encountered'. This probability is also computed across healthcare providers.

Usage

1
trans_hist_rate(tidy_set, hist_rate = NULL, interpolation = NULL, verbose = T)

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(). Only non-zero variance medical histories are taken. This is applied automatically. No need to use extract_nzv_mh() before plugging data for this function. It does not matter if extract_nps_mh() is applied, since non-perfect separation medical histories are also non-zero variance ones, conceivably.

hist_rate

Historical rate data, a data frame with three columns which are mh for medical history, time for days before the visit, and estimate for historical rate for each medical history at the time.

interpolation

Interpolation method, a character of interpolation method. This accepts following input: 'none', 'linear', 'spline', and 'stine'. If no interpolation is expected, then set to 'none'; thus, the same rate is applied as the later one. This will show a stair-step appearance in a typical Kaplan-Meier plot. Instead of a flat line among the times of the estimates, interpolation may be applied by linear, spline, and Stineman approximation.

verbose

Verbosity, a logical indicating whether progress should be shown.

Value

A TidySet (i.e. ExpressionSet) containing the visits of subjects in medical history and the outcome datasets. Since a code may be encountered before db_start_date, the value returns NA to denote censored data. This is accounted for Kaplan-Meier estimation. Historical rate table can be accessed using preproc() function from Biobase package.

Examples

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

## Transform medical history by normalizing day up to maximum database days
mh_hist_rate=trans_hist_rate(medhistdata)

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