bb_pi | R Documentation |
bb_pi()
is a helper function that is internally called by beta_bin_pi()
. It
calculates simple uncalibrated prediction intervals for binary
data with overdispersion changing between the clusters (beta-binomial).
bb_pi(
newsize,
histsize,
pi,
rho,
q = qnorm(1 - 0.05/2),
alternative = "both",
newdat = NULL,
histdat = NULL,
algorithm = NULL
)
newsize |
number of experimental units in the historical clusters |
histsize |
number of experimental units in the future clusters |
pi |
binomial proportion |
rho |
intra class correlation |
q |
quantile used for interval calculation |
alternative |
either "both", "upper" or "lower"
|
newdat |
additional argument to specify the current data set |
histdat |
additional argument to specify the historical data set |
algorithm |
used to define the algorithm for calibration if called via
|
This function returns a simple uncalibrated prediction interval
[l,u]_m = n^*_m \hat{\pi} \pm q \sqrt{n^*_m \hat{\pi} (1- \hat{\pi}) [1 + (n^*_m -1) \hat{\rho}] +
[\frac{n^{*2}_m \hat{\pi} (1- \hat{\pi})}{\sum_h n_h} + \frac{\sum_h n_h -1}{\sum_h n_h} n^{*2}_m \hat{\pi} (1- \hat{\pi}) \hat{\rho}]}
with n^*_m
as the number of experimental units in the m=1, 2, ... , M
future clusters,
\hat{\pi}
as the estimate for the binomial proportion obtained from the
historical data, \hat{\rho}
as the estimate for the intra class correlation
and n_h
as the number of experimental units per historical cluster.
The direct application of this uncalibrated prediction interval to real life data
is not recommended. Please use beta_bin_pi()
for real life applications.
bb_pi()
returns an object of class c("predint", "betaBinomialPI")
with prediction intervals or limits in the first entry ($prediction
).
# Pointwise uncalibrated PI
bb_pred <- bb_pi(newsize=c(50), pi=0.3, rho=0.05, histsize=rep(50, 20), q=qnorm(1-0.05/2))
summary(bb_pred)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.