Learn R Programming

QualityMeasure (version 2.0.1)

model_performance: Calculate model performance

Description

This function calculates risk model performance.

Usage

model_performance(
  df,
  model,
  entity = "entity",
  y = "y",
  data.type = "binary",
  predictor.clean = NULL,
  ctrPerf = controlPerf()
)

Value

A list containing: *data.type: type of data: binary or continuous *model: risk-adjustment model *fit: fitted model results *marg.p: overall, unadjusted outcome rate (for binary outcome data only) *c.statistic: c-statistic, a measure of discrimination *model.results: a dataframe with one row for each predictor in the model

Arguments

df

observation-level data; if null, will use the dataframe from the model object

model

model; if null, will use an unadjusted model

entity

data column containing the accountable entity identifier

y

data column containing the outcome variable

data.type

acceptable values are binary for 0/1 data and continuous for continuous data (default: binary)

predictor.clean

optional list of formatted names of predictors in the model

ctrPerf

parameters to control performance measure calculation

Author

Kenneth Nieser (nieser@stanford.edu)

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 estimated effects of predictors
plotEstimates(model.perf)


Run the code above in your browser using DataLab