FFTrees (version 1.4.0)

cuerank: Calculates thresholds that maximize a statistic (goal) for cues.

Description

Calculates thresholds that maximize a statistic (goal) for cues.

Usage

cuerank(formula = NULL, data = NULL, goal.threshold = "bacc",
  sens.w = 0.5, cost.outcomes = list(hi = 0, fa = 1, mi = 1, cr = 0),
  cost.cues = NULL, numthresh.method = "o", numthresh.n = 20,
  rounding = NULL, cue.rules = NULL, quiet = FALSE)

Arguments

formula

formula. A formula specifying a binary criterion as a function of multiple variables

data

dataframe. A dataframe containing variables in formula

goal.threshold

character. A string indicating the statistic to maximize when calculting cue thresholds: "acc" = overall accuracy, "wacc" = weighted accuracy, "bacc" = balanced accuracy

sens.w

numeric. A number from 0 to 1 indicating how to weight sensitivity relative to specificity.

cost.outcomes

list. A list of length 4 with names 'hi', 'fa', 'mi', and 'cr' specifying the costs of a hit, false alarm, miss, and correct rejection rspectively. E.g.; cost.outcomes = listc("hi" = 0, "fa" = 10, "mi" = 20, "cr" = 0) means that a false alarm and miss cost 10 and 20 respectively while correct decisions have no cost.

cost.cues

dataframe. A dataframe with two columns specifying the cost of each cue. The first column should be a vector of cue names, and the second column should be a numeric vector of costs. Cues in the dataset not present in cost.cues are assume to have 0 cost.

numthresh.method

character. A string indicating how to calculate cue splitting thresholds. "m" = median split, "o" = split that maximizes the goal,

numthresh.n

integer. The maximum number of numeric thresholds to be considered.

rounding

integer. An integer indicating digit rounding for non-integer numeric cue thresholds. The default is NULL which means no rounding. A value of 0 rounds all possible thresholds to the nearest integer, 1 rounds to the nearest .1 (etc.).

cue.rules

dataframe. Optional existing dataframe of previously defined cue rules.

quiet

logical. Should ongoing diagnostics be printed?

Value

A dataframe containing thresholds and marginal classification statistics for each cue

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
 # What are the best thresholds for each cue in the mushrooms dataset?
 mushrooms.cues <- cuerank(formula = poisonous ~.,
                           data = mushrooms)
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab