Learn R Programming

QualityMeasure (version 2.0.1)

plotPredictedDistribution: Plot densities of predicted values by outcome group

Description

This function creates a plot of the distributions of predicted values by outcome group

Usage

plotPredictedDistribution(model.performance)

Value

A ggplot figure

Arguments

model.performance

results from model_performance()

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)')

# Plot predicted distributions
plotPredictedDistribution(model.perf)


Run the code above in your browser using DataLab