Learn R Programming

healthcareai (version 1.2.4)

RiskAdjustedComparisons: Make risk adjusted comparisons between groups/units or years/months

Description

This class allows you to create a model based on the performance of many groups in a cohort (besides group A, for example) and see how well group A does against what the model would predict. Ranking each of the groups this way provides a sense of which group's doing best in terms of a particular measure.

Usage

RiskAdjustedComparisons(df, predictedCol, groupCol, impute)

Arguments

df

Dataframe whose columns are used for calc.

predictedCol

Column that you want to predict.

groupCol

Column that we'll use to differentiate

impute

Set all-column imputation to F or T.

Format

An object of class R6ClassGenerator of length 24.

References

http://healthcareai-r.readthedocs.io

See Also

healthcareai

Examples

Run this code
# NOT RUN {
#### Example using SQL data ####

# }
# NOT RUN {
library(healthcareai)

connection.string <- "
driver={SQL Server};
server=localhost;
database=SAM;
trusted_connection=true
"

query <- "
SELECT
[PatientEncounterID]
,[PatientID]
,[SystolicBPNBR]
,[LDLNBR]
,[A1CNBR]
,[GenderFLG]
,[ThirtyDayReadmitFLG]
FROM [SAM].[dbo].[HCRDiabetesClinical]
"

df <- selectData(connection.string, query)

p <- SupervisedModelDevelopmentParams$new()
p$df <- df
p$groupCol <- "GenderFLG"
p$impute <- TRUE
p$predictedCol <- "ThirtyDayReadmitFLG"
p$debug <- FALSE
p$cores <- 1

riskAdjComp <- RiskAdjustedComparisons$new(p)
riskAdjComp$run()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab