Learn R Programming

riskyr (version 0.1.0)

comp_popu: Compute a population table from frequencies.

Description

comp_popu is a function that computes a table popu (as an R data frame) from the current frequency information (contained in freq).

Usage

comp_popu(hi = freq$hi, mi = freq$mi, fa = freq$fa, cr = freq$cr,
  cond.true.lbl = txt$cond.true.lbl, cond.false.lbl = txt$cond.false.lbl,
  dec.pos.lbl = txt$dec.pos.lbl, dec.neg.lbl = txt$dec.neg.lbl,
  hi.lbl = txt$hi.lbl, mi.lbl = txt$mi.lbl, fa.lbl = txt$fa.lbl,
  cr.lbl = txt$cr.lbl)

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).

cond.true.lbl

Text label for cond.true cases.

cond.false.lbl

Text label for cond.false cases.

dec.pos.lbl

Text label for dec.pos cases.

dec.neg.lbl

Text label for dec.neg cases.

hi.lbl

Text label for hi cases.

mi.lbl

Text label for mi cases.

fa.lbl

Text label for fa cases.

cr.lbl

Text label for cr cases.

Value

A data frame popu containing N rows (individual cases) and 3 columns ("Truth", "Decision", "SDT") encoded as ordered factors (with 2, 2, and 4 levels, respectively).

Format

An object of class data.frame with N rows and 3 columns ("Truth", "Decision", "SDT").

Details

comp_popu also uses the current text settings contained in txt.

A visualization of the current population contained in popu is provided by plot_icon.

See Also

The corresponding data frame popu; num for basic numeric parameters; freq for current frequency information; txt for current text settings; pal for current color settings.

Other functions computing frequencies: comp_freq_freq, comp_freq_prob, comp_freq, comp_min_N, comp_prob_prob

Examples

Run this code
# NOT RUN {
comp_popu(hi = 4, mi = 1, fa = 2, cr = 3)  # => computes a table of N = 10 cases

popu <- comp_popu()  # => initializes popu (with current values of freq and txt)
dim(popu)            # => N x 3
head(popu)           # => shows head of data frame


# }

Run the code above in your browser using DataLab