Learn R Programming

QualityMeasure (version 2.0.1)

calcPerformance: Calculate measure performance by accountable entity

Description

This function calculates measure performance by accountable entity.

Usage

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

Value

A list including: *df: a cleaned dataframe used to calculate measure performance *model: the model used to calculate measure performance *fit: the fitted model results *marg.p: overall, unadjusted average performance across all entities *perf.results: performance results by entity

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 (default: binary)

ctrPerf

parameters to control performance measure calculation

Author

Kenneth Nieser (nieser@stanford.edu)

Examples

Run this code
# simulate data
df <- simulateData(n.entity = 50, n.obs = 100, mu = .2, r = .7)

# calculate measure performance
out <- calcPerformance(df = df, entity = 'entity', y = 'y')

# plot performance
plotPerformance(out$perf.results)

Run the code above in your browser using DataLab