icd9Clean: Reformat Comorbidity Measures

View source: R/cmbd.R

icd9CleanR Documentation

Reformat Comorbidity Measures

Description

This function processes the character matrix of ICD9 codes by converting them to character codes of length 5. For SAS procedure from HCUP, it trims all character string to be of length 5, adds the missing trailing white space, and capitalizes the first character in ICD9 codes.

Usage

icd9Clean(input, style = c("touch", "hcup"))

Arguments

input

a character matrix of ICD9 codes, with rows representing patients.

style

a character vector of length one indicating the reformatting style to follow. The possible option are "touch" and "hcup". The former does the cleaning for this package; The latter does the reformatting for the SAS script provided by HCUP.

Value

a matrix of cleaned ICD9 codes.

Author(s)

Jun Yan and Wenjie Wang

Examples

data(dxDat)
icd <- dxDat[, -1L]
output <- icd9Clean(icd)

touch documentation built on July 8, 2022, 9:06 a.m.