samplesize {HDDesign} | R Documentation |
Determine the Sample Size Requirement
Description
Determine the sample size to achieve the target probability of correct classification (PCC) using various design methods. Sample sizes are chosen using a binary search algorithm between the range nmin to nmax.
Usage
samplesize(target, nmin, nmax, f, ...)
Arguments
target |
Set the target probability of correct classifcation (PCC) for the study. |
nmin |
The mimimum sample size for both groups combined. Typically 0.05 smaller than the ideal PCC. It must be an even number. |
nmax |
The maximum sample size for both groups combined. So it must be an even number. |
f |
Specify the PCC estimation function: ds_method, cv_method, or hct_method |
... |
The design assumptions and other arguments for the PCC estimation function, f. |
Value
The smallest sample size that achieves the target PCC.
Author(s)
Meihua Wu <meihuawu@umich.edu> Brisa N. Sanchez <brisa@umich.edu> Peter X.K. Song <pxsong@umich.edu> Raymond Luu <raluu@umich.edu> Wen Wang <wangwen@umich.edu>
Examples
set.seed(1)
samplesize(target=0.8, nmin=20, nmax=100, hct_method, mu0=0.4, p=500,
m=10, hct=hct_beta, alpha0=0.5, nrep=100)
#return: 78.0000000 0.8043205