comp_freq_freq: Compute frequencies from (4 essential) frequencies.

View source: R/comp_freq_freq.R

comp_freq_freqR Documentation

Compute frequencies from (4 essential) frequencies.

Description

comp_freq_freq computes current frequency information from 4 essential frequencies (hi, mi, fa, cr). It returns a list of 11 frequencies freq for a population of N individuals as its output.

Usage

comp_freq_freq(hi = freq$hi, mi = freq$mi, fa = freq$fa, cr = freq$cr)

Arguments

hi

The number of hits hi (or true positives).

mi

The number of misses mi (or false negatives).

fa

The number of false alarms fa (or false positives).

cr

The number of correct rejections cr (or true negatives).

Details

Key relationships between frequencies and probabilities (see documentation of comp_freq or comp_prob for details):

  • Three perspectives on a population:

    by condition / by decision / by accuracy.

  • Defining probabilities in terms of frequencies:

    Probabilities can be computed as ratios between frequencies, but beware of rounding issues.

Functions translating between representational formats: comp_prob_prob, comp_prob_freq, comp_freq_prob, comp_freq_freq (see documentation of comp_prob_prob for details).

See Also

comp_freq_prob computes current frequency information from (3 essential) probabilities; comp_prob_freq computes current probability information from (4 essential) frequencies; comp_prob_prob computes current probability information from (3 essential) probabilities; num contains basic numeric parameters; init_num initializes basic numeric parameters; prob contains current probability information; comp_prob computes current probability information; freq contains current frequency information; comp_freq computes current frequency information; is_prob verifies probability inputs; is_freq verifies frequency inputs.

Other functions computing frequencies: comp_freq_prob(), comp_freq(), comp_min_N(), comp_prob_prob()

Other format conversion functions: comp_freq_prob(), comp_prob_freq(), comp_prob_prob()

Examples

## Basics:
comp_freq_freq()
all.equal(freq, comp_freq_freq())  # => should be TRUE

## Circular chain:
# 1. Current numeric parameters:
num

# 2. Compute all 10 probabilities in prob (from essential probabilities):
prob <- comp_prob()
prob

# 3. Compute 9 frequencies in freq from probabilities:
freq <- comp_freq(round = FALSE)   # no rounding (to obtain same probabilities later)
freq

# 4. Compute 9 frequencies AGAIN (but now from frequencies):
freq_freq <- comp_freq_freq()

# 5. Check equality of results (steps 2. and 4.):
all.equal(freq, freq_freq)  # => should be TRUE!


riskyr documentation built on Aug. 15, 2022, 9:09 a.m.