Description Usage Arguments Examples
View source: R/bin_calculations.R
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
1 | bin_calculations(data, varname, outcomevar, bins)
|
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. |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.