EpiBayes_ns
across a given number of time periods. Generally, this is
accomplished by starting out with a user-defined prior distribution on the
cluster-level prevalence (tau
), updating this prior using observed data,
using this posterior distribution as the prior distribution in the second time
period, and repeating this process for all time periods -- we hope to implement
a way to incorporate a measurement of introduction risk of the disease in
between time periods, but for now we assume that the disease retains its original
properties among all time periods.
EpiBayesHistorical(input.df, orig.tauparm, MCMCreps, burnin = 1000, ...)
EpiBayes_ns
. The matrix will have one
row per cluster and will have five columns. The columns should have the order:
Time Period, Subzone, Cluster Size, Season, and
Positive Diagnostic Test Results (y). See Details
for more information. Real matrix (sum(k)
x 5).EpiBayes_ns
.
Otherwise, the default values will be used.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 |
input.df
should have the following columns, in this order:
c(2015, 2015, 2016, ...)
.
c("CO", "CO", "IN", ...)
.
c(100, 500, 250, ...)
.
c(1, 1, 4, ...)
.
c(0, 4, 1, ...)
. Note:
if so desired, the user may let the model generate sample data automatically
when there is no concrete sample data with which to work.
## Construct input data frame with columns Year, Subzone, Cluster size, Season, and Number positives
year = rep(c("Period 1", "Period 2", "Period 3"), c(60, 60, 60))
subz = rep(rep(c("Subzone 1", "Subzone 2"), c(25, 35)), 3)
size = rep(100, 3 * 60)
season = rep(rep(c(1,2), each = 30), 3)
y = matrix(c(
rep(10, 15), rep(0, 10), # Period 1: Subzone 1
rep(0, 35), # Period 1: Subzone 2
rep(10, 15), rep(0, 10), # Period 2: Subzone 1
rep(10, 10), rep(0, 25), # Period 2: Subzone 2
rep(25, 25), # Period 3: Subzone 1
rep(25, 10), rep(0, 25) # Period 3: Subzone 2
),
ncol = 1
)
testrun_historical_inputdf = data.frame(year, subz, size, season, y)
testrun_historical = EpiBayesHistorical(
input.df = testrun_historical_inputdf,
orig.tauparm = c(1, 1),
burnin = 1,
MCMCreps = 5,
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,
tau.T = 0,
poi.lb = 0,
poi.ub = 1,
p1 = 0.95,
psi = 4,
omegaparm = c(1, 1),
gamparm = c(1, 1),
etaparm = c(10, 1),
thetaparm = c(10, 1)
)
testrun_historical
plot(testrun_historical)
testrun_historicalsummary = summary(testrun_historical, sumstat = "quantile",
prob = 0.99, time.labels = c("Period 1", "Period 2", "Period 3"))
testrun_historicalsummary
plot(testrun_historicalsummary)
Run the code above in your browser using DataLab