generate_charlson_index_df {medicalrisk}R Documentation

Calculate the Charlson Comorbidity Index

Description

generate_charlson_index_df merges a data frame of Charlson comorbidities with charlson_weights and sums the results per patient.

Usage

generate_charlson_index_df(
  df,
  idvar = "id",
  weights = medicalrisk::charlson_weights
)

Arguments

df

a data frame with ID column idvar and logical columns for each comorbidity, such as that generated by generate_comorbidity_df

idvar

string with name of ID variable within df

weights

defaults to charlson_weights

Value

a dataframe with two columns, idvar and "index"

See Also

generate_comorbidity_df, charlson_weights, charlson_weights_orig

Examples

# calculate Charlson Comorbidity Index for all patients in the \code{\link{vt_inp_sample}}
data(vt_inp_sample)
generate_charlson_index_df(generate_comorbidity_df(vt_inp_sample))

[Package medicalrisk version 1.3 Index]