The function uses nNPVPPV
and implement the methods described in section 3.2 of Steinberg et al.(2009).
The results for NPV are the smallest integers fulfilling Eq.(3.6) and NA if necesarry conditions mentioned before are not met,
the results for PPV are the smallest integers fulfilling Eq.(3.8) and NA if necesarry conditions mentioned before are not met.
The arguments se
, sp
, prev
, NPV0
, PPV0
, NPVpower
, PPVpower
can be given as vectors or single values, where shorter values are recycled to the length of the longest. The proportion of true positives is varied over nstep
equidistant values over the range specified in argument rangeP
.
On each resulting parameter set, the asymptotic sample size formulas of Steinberg et al.(2009) are applied.
The result of those calculations may be plot using plotnPV
and plotnPV2
.
Warnings are returned by the internal function nNPV and nPPV if the validity of asymptotic formulas under binomial sampling may be doubtable, namely when the asymptotic formulas return a total sample size n for given propP, se, sp, such that
min(n*propP*se, n*propP*(1-se))<5 or min(n*(1-propP)*sp, n*(1-propP)*(1-sp))<5. That is, a warning is returned if the proposed design of the case-control study (n1, n0) = (n*propP, n*(1-propP)) leads to expected counts < 5 for any cell of the 2x2 table.