Description Usage Arguments Value Examples
View source: R/EpiBayesSampleSize.R
This function takes three vectors for the number of subzones, clusters per subzone, and
subjects per cluster per subzone and uses all combinations of the given values
as inputs to EpiBayes_ns
as a way to search for sample sizes which give
optimal values of the Bayesian model output (e.g., p4.tilde
). It assumes that
at every sampling level, all elements have the same size (e.g., if the user supplies
H = 2, k = 10, n = 100, then we assume that there are two subzones, both of which
contain 10 clusters/farms/ponds/herds, and all clusters in all subzones contain
100 subjects/individuals/mollusks/cows/chickens). This is done for computational
efficiency in the search.
1 | EpiBayesSampleSize(H.vect, k.vect, n.vect, season.vect, ...)
|
H.vect |
Values of possible numbers of subzones. Integer vector. |
k.vect |
Values of possible numbers of clusters within subzones. Integer vector. |
n.vect |
Values of possible numbers of subjects within clusters within subzones. Integer vector. |
season.vect |
The single season in which one assumes sampling is taking place. Coded as (1) Summer, (2) Fall, (3) Winter, (4) Spring. Integer scalar. |
... |
Additional arguments that will be passed to |
The returned values are given in a matrix. They are as follows.
Output | Attributes | Description |
RawPost | List: Length - (number of periods), Elements - Real arrays (reps x H x MCMCreps ) | Posterior distributions for the cluster-level prevalences for each subzone from all time periods |
BetaBusterEst | List: Length - (number of periods), Elements - Real vectors (2 x 1) | Estimated posterior distributions for the cluster-level prevalences for each subzone from all time periods using moment-matching to the closest beta distribution by the function epi.betabuster |
ForOthers | Various other data not intended to be used by the user, but used to pass information on to the plot , summary , and print methods |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | testrun_samplesize = EpiBayesSampleSize(
H = c(2, 4),
k = c(10, 20),
n = c(100, 500),
season = 3,
burnin = 1,
reps = 1,
MCMCreps = 10,
tau.T = 0,
poi = "tau",
mumodes = matrix(c(
0.50, 0.70,
0.50, 0.70,
0.02, 0.50,
0.02, 0.50
), 4, 2, byrow = TRUE
),
pi.thresh = 0.05,
tau.thresh = 0.02,
gam.thresh = 0.10,
poi.lb = 0.1,
poi.ub = 0.4,
p1 = 0.95,
psi = 4,
tauparm = c(1, 1),
omegaparm = c(1000, 1),
gamparm = c(1000, 1),
etaparm = c(100, 6),
thetaparm = c(100, 6)
)
testrun_samplesize
print(testrun_samplesize, out.ptilde = "p4.tilde")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.