Learn R Programming

QualityMeasure (version 2.0.1)

plotCalibration: Plot calibration curve for risk-adjustment model

Description

This function creates a plot of the model calibration curve

Usage

plotCalibration(model.performance, quantiles = 10)

Value

A ggplot figure

Arguments

model.performance

results from model_performance()

quantiles

number of quantiles to bin data; default is 10.

Author

Kenneth Nieser (nieser@stanford.edu)

Details

This function only works for binary outcome data.

Examples

Run this code
# Simulate data
df <- simulateData(n.entity = 100, n.obs = 80, mu = 0.2, r = 0.6, beta1 = log(1.6))

# Calculate risk-adjustment model performance
model.perf <- model_performance(df = df, model = 'y ~ x1 + (1|entity)')

# Calibration plots
plotCalibration(model.perf)
plotCalibration(model.perf, quantiles = 5)

Run the code above in your browser using DataLab