ag_calc: A_g statistic calculation

Description Usage Arguments Examples

View source: R/ag_calc.R

Description

This function takes a dataframe with a to-be-binned variable along with the outcome variable by which the type-2 calculations are based on and returns the A_g statistic described by Masson and Rotello (2009)

Usage

1
ag_calc(data, varname, outcomevar, bins)

Arguments

data

a dataframe that holds the judgment and outcome variables.

varname

the name of the variable that is to be binned.

outcomevar

the name of the outcome variable that the hit and false alarm bin calculations are based on.

bins

a positive integer indicating the number of bins for the calculations.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Randomly select 100 integers from 0 - 100.
set.seed(2)
a <- sample(0:100,100,replace=TRUE)

# Randomly select 100 integers of 0 or 1.
set.seed(2)
b <- sample(0:1,100,replace=TRUE)

# Send to data frame.
c <- data.frame(a,b)

# Send to function; output A_g statistic
ag_calc(c, varname = "a", outcomevar = "b", bins = 5)

tmc2737/t2roc documentation built on May 29, 2019, 9:31 a.m.