Calculates population-level (system) sensitivity for representative 2-stage sampling (sampling of clusters and units within clusters), assuming imperfect test sensitivity and perfect test specificity

1 |

`H` |
population size = number of clusters in the population, default = NA |

`N` |
population size within clusters, scalar or a vector of same length as n, default = NA |

`n` |
sample size (vector of number tested per cluster) |

`pstar.c` |
cluster (herd) level design prevalence, scalar, either proportion or integer |

`pstar.u` |
unit (animal) level design prevalence, scalar, either proportion or integer |

`se` |
unit sensitivity of test (proportion), scalar, default = 1 |

list of 6 elements, 1) population level sensitivity, 2) vector of cluster-level sensitivities, 3) N, 4) n, 5) vector of design prevalences and 6) unit sensitivity

if pstar.c is not a proportion N must be provided (and N>=n)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
# examples for sep.sys - checked
H<- 500
N<- rep(1000, 150)
N[5]<- NA
n<- rep(30, 150)
pstar.u<- 0.1
pstar.c<- 0.01
se<- 0.98
sep.sys(H, N, n, pstar.c, pstar.u, se)
sep.sys(NA, N, n, 0.02, 0.05, 0.95)
N<- round(runif(105)*900+100)
n<- round(runif(105)*30+10)
sse<- sep.sys(1000, N, n, 0.02, 0.05, 0.9)
data.frame(N, n, sse[[2]])
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.