Learn R Programming

ThresholdROC (version 2.2)

SS: Sample size estimation (two-state setting)

Description

Estimates the sample size and the optimum sample size ratio needed for a given width, costs, disease prevalence and significance level under the assumption of binormality.

Usage

SS(par1.1, par1.2, par2.1, par2.2=NULL, rho, width,
  costs=matrix(c(0, 0, 1, (1-rho)/rho), 2, 2, byrow=TRUE),
  var.equal=FALSE, alpha=0.05)

Arguments

par1.1
healthy population mean.
par1.2
healthy population standard deviation.
par2.1
diseased population mean.
par2.2
diseased population standard deviation. It can be omitted when assuming equal variances (that is, when var.equal=TRUE) and in this situation the common variance is assumed to be equal to par1.2.
rho
disease prevalence.
width
desired interval width.
costs
cost matrix. Costs should be entered as a 2x2 matrix, where the first row corresponds to the true positive and true negative costs and the second row to the false positive and false negative costs. Default cost values are a combination of costs that yield
var.equal
a logical variable indicating whether to use equal variances. Default, FALSE.
alpha
significance level for the confidence interval. Default, 0.05.

Value

  • an object of class SS which is a list with eight components:
  • ss2sample size for the healthy group
  • ss1sample size for the diseased group
  • epsilonsample size ratio between non-diseased and diseased subjects
  • widthwidth of the confidence interval provided by the user
  • alphasignificance level provided by the user
  • costscost matrix provided by the user
  • RR term, the product of the non-disease odds and the cost ratio (for further details about this concept, see References)
  • prevdisease prevalence provided by the user

References

Skaltsa K, Jover L, Carrasco JL. (2010). Estimation of the diagnostic threshold accounting for decision costs and sampling uncertainty. Biometrical Journal 52(5):676-697.

Examples

Run this code
par1.1 <- 0
par1.2 <- 1
par2.1 <- 2
par2.2 <- 1
rho <- 0.3
width <- 0.5
SS(par1.1, par1.2, par2.1, par2.2, rho, width, var.equal=TRUE)

Run the code above in your browser using DataLab