qb_pi {predint} | R Documentation |
Simple uncalibrated prediction intervals for quasi-binomial data
Description
qb_pi()
is a helper function that is internally called by quasi_bin_pi()
. It
calculates simple uncalibrated prediction intervals for binary
data with constant overdispersion (quasi-binomial assumption).
Usage
qb_pi(
newsize,
histsize,
pi,
phi,
q = qnorm(1 - 0.05/2),
alternative = "both",
newdat = NULL,
histdat = NULL,
algorithm = NULL
)
Arguments
newsize |
number of experimental units in the historical clusters. |
histsize |
number of experimental units in the future clusters. |
pi |
binomial proportion |
phi |
dispersion parameter |
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
|
Details
This function returns a simple uncalibrated prediction interval
[l,u]_m = n^*_m \hat{\pi} \pm q \sqrt{\hat{\phi} n^*_m \hat{\pi} (1- \hat{\pi}) +
\frac{\hat{\phi} n^{*2}_m \hat{\pi} (1- \hat{\pi})}{\sum_h n_h}}
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{\phi}
as the estimate for the dispersion parameter
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 the beta_bin_pi()
functions for real life applications.
Value
qb_pi
returns an object of class c("predint", "quasiBinomailPI")
.
Examples
qb_pred <- qb_pi(newsize=50, pi=0.3, phi=3, histsize=c(50, 50, 30), q=qnorm(1-0.05/2))
summary(qb_pred)