trans_binary: Transform medical history by binarizing day interval

Description Usage Arguments Value Examples

View source: R/trans_binary-function.R

Description

This function transforms each medical history from day interval to binary one. If there is no record, then the value is 0; otherwise, the value is 1.

Usage

1
trans_binary(tidy_set, 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().

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, causing the value returns NA to denote censored data, that medical history is transformed to 0. But, if the interval is 0, the value returns 1 because this means the record exists.

Examples

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

## Transform medical history by binarizing day interval
mh_binary=trans_binary(medhistdata)

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