Usage
samplingerror(
data,
detectionSensitivity = 95,
biologicalVarianceCV = 15,
sampleSize = 10,
eventFrequency = 5,
referenceVolume = 100,
sampleVolume = 10,
calculationMode = "theoretical",
sampleData = NULL,
targetError = 10,
showErrorComponents = TRUE,
showOptimization = TRUE,
showVisualization = TRUE,
showMethodology = TRUE,
showReferences = FALSE,
confidenceLevel = 0.95
)Arguments
- data
.
- detectionSensitivity
Probability of correctly detecting/identifying an event (e.g., tumor cell). 100\ false negative rate.
- biologicalVarianceCV
Coefficient of variation representing tissue heterogeneity. Low (5-10\ moderate heterogeneity, High (>30\
sampleSizeNumber of samples/sections/areas examined.
eventFrequencyProportion of sample containing the event of interest (e.g., \referenceVolumeTotal reference space being sampled (e.g., organ volume, total tissue area).sampleVolumeVolume/area of each sample examined (same units as reference volume).calculationModeTheoretical: Calculate error from theoretical parameters. Empirical: Estimate error components from actual data.sampleDataActual measurements from samples (for empirical calculation).targetErrorDesired maximum total sampling error. Used for sample size recommendations.showErrorComponentsDisplay breakdown of the three error components: E(Ne), E(B(n)), E(Ne/sv).showOptimizationCalculate optimal sample sizes for different target error rates.showVisualization.showMethodology.showReferences.confidenceLevel. A results object containing:
Tables can be converted to data frames withresults$errorSummarya table results$errorComponentsa table results$optimizationa table results$plotan image results$methodologya html results$referencesa html asDForas.data.frame. For example:results$errorSummary$asDFas.data.frame(results$errorSummary)Practical tool for evaluating sampling adequacy and statistical power in clinicopathological research. Calculates sampling efficiency and error rates according to Kayser (2009).