Title: | Deficit Index (DI) |
---|---|
Description: | A set of utilities for calculating the Deficit (frailty) Index (DI) in gerontological studies. The deficit index was first proposed by Arnold Mitnitski and Kenneth Rockwood and represents a proxy measure of aging and also can be served as a sensitive predictor of survival. For more information, see (i)"Accumulation of Deficits as a Proxy Measure of Aging" by Arnold B. Mitnitski et al. (2001), The Scientific World Journal 1, <DOI:10.1100/tsw.2001.58>; (ii) "Frailty, fitness and late-life mortality in relation to chronological and biological age" by Arnold B Mitnitski et al. (2001), BMC Geriatrics2002 2(1), <DOI:10.1186/1471-2318-2-1>. |
Authors: | Ilya Y. Zhbannikov [aut, cre] |
Maintainer: | Ilya Y. Zhbannikov <[email protected]> |
License: | GPL-3 |
Version: | 1.1.4 |
Built: | 2024-12-06 06:35:23 UTC |
Source: | CRAN |
di
a column-vector containing
deficit indexes for each individual and
columns
that were used to calculate the di
.This function calculates the Deficit Index (DI) and returns results
as list: di
a column-vector containing
deficit indexes for each individual and
columns
that were used to calculate the di
.
di(dat, cols = NULL, invert = NULL, rescale = TRUE, age = NULL, rescale.custom = NULL, rescale.avoid = NULL, bins = 7, visible = FALSE)
di(dat, cols = NULL, invert = NULL, rescale = TRUE, age = NULL, rescale.custom = NULL, rescale.avoid = NULL, bins = 7, visible = FALSE)
dat |
A data frame. Required parameter. |
cols |
A list of column names.
Default: |
invert |
A list of columns which have to be inverted.
Default: |
rescale |
A flag that tell the program to rescale columns
if the values a not 0/1. Default: |
age |
A name of column which represents age of a patient.
Default: |
rescale.custom |
A custom rescaling. See example below.
Default: |
rescale.avoid |
A set of column names for which rescaling should be avoided.
Default: |
bins |
A number of bins for plotting the DI against age from a dataset.
Default: |
visible |
A flag to show DI plot (mean DI in a population by age)
Default: |
A list of two: di
a column-vector containing
deficit indexes for each individual and
columns
(rescaled if flag rescale
was set to TRUE
)
that were used to calculate the di
.
library(di) dd <- data.frame(subj=seq(1:100), var1=rbinom(100,1,.5), var2=rbinom(100,1,.5), var3=rbinom(100,1,.5)) ddi <- di(dd, c("var1", "var2", "var3")) # Cusom rescaling ddi <- di(dd, c("var1", "var2", "var3"), rescale.custom=c("var1:0.1:0.5")) ddi
library(di) dd <- data.frame(subj=seq(1:100), var1=rbinom(100,1,.5), var2=rbinom(100,1,.5), var3=rbinom(100,1,.5)) ddi <- di(dd, c("var1", "var2", "var3")) # Cusom rescaling ddi <- di(dd, c("var1", "var2", "var3"), rescale.custom=c("var1:0.1:0.5")) ddi