cueValidity: Calculate the cue validity.

Description Usage Arguments Value References See Also Examples

View source: R/cue_validity.R

Description

Calculate the cue validity for a pair of vectors. It is calculated as correct / (correct + incorrect).

Usage

1
cueValidity(criterion, cue, replaceNanWith = 0.5)

Arguments

criterion

A vector of values to be predicted.

cue

A vector of values to predict with. Should have the same length as the criterion.

replaceNanWith

The value to return as cue validity in case it cannot be calculated, e.g. no variance in the values.

Value

The cue validity, a value in the range [0,1].

References

Wikipedia's entry on https://en.wikipedia.org/wiki/Cue_validity

See Also

cueValidityComplete for more complete output.

conditionalCueValidityComplete for a version where validity is conditional on cues already used to make decisions.

cueAccuracy for a measure that takes guesses into account.

Examples

1
2
3
4
5
6
7
8
cueValidity(c(5,1), c(1,0))
# Returns 1.
cueValidity(c(5,2,1), c(1,0,0))
# Also returns 1
cueValidity(c(5,2,1), c(0,0,1))
# Returns 0.
cueValidity(c(5,2,1), c(1,0,1))
# Returns 0.5.

heuristica documentation built on Sept. 8, 2021, 9:08 a.m.