cpa: Computes coefficient of predictive ability (CPA).

View source: R/cpa.R

cpaR Documentation

Computes coefficient of predictive ability (CPA).

Description

This function computes the coefficient of predictive ability which is equalivalent to the area under the UROC curve. Two syntaxes are possible: one object of class "uroc" or two vectors, the response and the predictor.

Usage

cpa(...)

## Default S3 method:
cpa(response, predictor, ...)

## S3 method for class 'uroc'
cpa(uroc, ...)

Arguments

...

ignored

response

a numeric vector of real valued responses.

predictor

a numeric vector of the same length as response, containing real valued predictions for each observation.

uroc

an object of class "uroc" contaning the values of the false alarm rate (1-specificity) and the hitrate (sensitivity) of the UROC curve.

Details

The CPA is an asymmetric measure that is linearly related to the correlation between the classes of the response variable and the ranks of the predictor.

Value

The numeric CPA value.

Examples


data(longley)
response = longley$Employed
predictor = longley$GNP
cpa(response, predictor)

evwalz/uroc documentation built on May 22, 2022, 1:40 a.m.