Description Usage Arguments Value Examples
View source: R/trans_hist_rate-function.R
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.
1 | trans_hist_rate(tidy_set, hist_rate = NULL, interpolation = NULL, verbose = T)
|
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 |
hist_rate |
Historical rate data, a data frame with three columns which
are |
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. |
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.