Description Usage Arguments Value Examples

View source: R/freedom_functions_1.R

Calculates sample sizes for a 2-stage representative survey (sampling of clusters and units within clusters) for disease freedom or detection, assuming imperfect test sensitivity, perfect test specificity and representative sampling

1 2 |

`H` |
population size = number of clusters or NA if not known, default = NA |

`N` |
population sizes for clusters, default = NA, scalar or vector of population sizes for clusters |

`sep.sys` |
desired population sensitivity (scalar) |

`sep.c` |
desired cluster-level sensitivity (scalar) |

`pstar.c` |
specified cluster-level design prevalence as proportion or integer (scalar) |

`pstar.u` |
specified population-level design prevalence as proportion or integer (scalar) |

`se` |
unit sensitivity (scalar) |

a list of 2 elements, the number of clusters to sample and a vector of sample sizes per cluster

1 2 3 4 5 6 | ```
# examples of n.2stage - checked
n.2stage(NA, NA, 0.95, 0.5, 0.01, 0.1, 0.95)
n.2stage(500, NA, 0.95, 0.5, 10, 0.1, 0.95)
n.2stage(1000, c(50, 100, 200, 500, 1000, 5000, NA), 0.95, 0.5, 0.01, 0.05, 0.8)
n.2stage(1000, c(50, 100, 200, 500, 1000, 5000, NA), 0.95, 0.5, 0.01, 1, 0.8)
n.2stage(1000, c(50, 100, 200, 500, 1000, 5000, NA), 0.9, 0.95, 1, 0.1, 0.8)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.