bin_calculations: Bin judgments and perform calculations

Description Usage Arguments Examples

View source: R/bin_calculations.R

Description

This function takes a dataframe, bins the judgments by the number given to the program, and performs hit and false alarm rate calculations for the outcome variable according to each bin

Usage

1
bin_calculations(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 bins + calculations
bin_calculations(c, varname = "a", outcomevar = "b", bins = 5)

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