a_priori_est: A priori estimations

View source: R/prevalence_calc.R

a_priori_estR Documentation

A priori estimations

Description

This function provides estimations for the sample size required for the event that at least a minimum number of participants used the desired devices to have a specified minimum probability. By default, the function returns the screening procedure that requires the smallest sample size for this event. To return screening procedures with similar required sample sizes use the parameter tolerance.

Usage

a_priori_est(
  baserate_hp = 211/1194,
  devices = "HP",
  min_number,
  min_prob = 0.8,
  tolerance = as.integer(0)
)

Arguments

baserate_hp

Sets the (estimated) prevalence of headphones in the target population as a number between 0 and 1. Defaults to the unbiased prevalence B of 0.1767 from \insertCiteHALT_2;textualHALT.

devices

Sets the desired playback device. Possible settings are "HP" for headphones or "LS" for loudspeakers.

min_number

minimum number of participants passing the test procedure and using the target devices

min_prob

minimum probability (equal to or greater than 0.6, less than 1) for the event that at least min_number participants pass the test procedure and use the target devices.

tolerance

(non-negative integer) defaults to 0. A value of 0 searches for the screening procedures with the minimum sample size. If set to a value > 0 the function returns the screening procedures whose sample sizes exceed the minimum sample size by at most this value.

Value

A tibble (data frame) with the characteristics of the test procedure(s) and the attribute explanation. This attribute is intended as an explanatory text containing a probabilistic statement for the test procedure requiring the smallest sample size.

Model

The function uses the Normal approximation of the Binomial distribution with continuity correction. For details, see \insertCiteHALT_2;textualHALT.

References

\insertAllCited

klausfrieler/HALT documentation built on March 17, 2023, 6:18 a.m.