Description Usage Arguments Details Value See Also Examples

View source: R/comp_freq_prob.R

`comp_min_N`

is a function that computes a population size value `N`

(an integer
as a power of 10) so that the frequencies of the 4 combinations of conditions and decisions
(i.e., the cells of the confusion table, or bottom row of boxes in the natural frequency tree)
reach or exceed a minimum value `min.freq`

given the basic parameters
`prev`

, `sens`

, and `spec`

(`spec = 1 - fart`

).

1 | ```
comp_min_N(prev, sens, spec, min.freq = 1)
``` |

`prev` |
The condition's prevalence value |

`sens` |
The decision's sensitivity value |

`spec` |
The specificity value |

`min.freq` |
The minimum frequency of each combination of
a condition and a decision (i.e., hits, misses, false alarms, and correct rejections).
Default: |

Using this function helps avoiding excessively small decimal values in categories
(esp. true positives, false negatives, false positives, and true negatives)
when expressing combinations of conditions and decisions as natural frequencies.
As values of zero (0) are tolerable, the function only increases `N`

(in powers of 10) while the current value of any frequency (cell in confusion table or
leaf of tree) is positive but below `min.freq`

.

Note that `comp_freq`

still needs to round to avoid decimal values
in frequencies `freq`

.

An integer value `N`

(as a power of 10).

population size `N`

;
`num`

contains basic numeric parameters;
`freq`

contains current frequency information;
`comp_freq`

computes frequencies from probabilities;
`prob`

contains current probability information;
`comp_prob`

computes probabilities from probabilities;
`comp_freq_freq`

computes current frequency information from (4 essential) frequencies;
`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.

Other functions computing frequencies: `comp_freq_freq`

,
`comp_freq_prob`

, `comp_freq`

,
`comp_popu`

, `comp_prob_prob`

1 2 3 4 5 6 7 8 9 10 | ```
comp_min_N(0, 0, 0) # => 1
comp_min_N(1, 1, 1) # => 1
comp_min_N(1, 1, 1, min.freq = 10) # => 10
comp_min_N(1, 1, 1, min.freq = 99) # => 100
comp_min_N(.1, .1, .1) # => 100 = 10^2
comp_min_N(.001, .1, .1) # => 10 000 = 10^4
comp_min_N(.001, .001, .1) # => 1 000 000 = 10^6
comp_min_N(.001, .001, .001) # => 1 000 000 = 10^6
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.