lmer_pi {predint} | R Documentation |
Prediction intervals for future observations based on linear random effects models (DEPRECATED)
Description
This function is deprecated. Please use lmer_pi_unstruc()
,
lmer_pi_futvec()
or lmer_pi_futmat()
.
Usage
lmer_pi(
model,
newdat = NULL,
m = NULL,
alternative = "both",
alpha = 0.05,
nboot = 10000,
lambda_min = 0.01,
lambda_max = 10,
traceplot = TRUE,
n_bisec = 30
)
Arguments
model |
a random effects model of class |
newdat |
a |
m |
number of future observations |
alternative |
either "both", "upper" or "lower". |
alpha |
defines the level of confidence (1- |
nboot |
number of bootstraps |
lambda_min |
lower start value for bisection |
lambda_max |
upper start value for bisection |
traceplot |
if |
n_bisec |
maximal number of bisection steps |
Details
This function returns a bootstrap calibrated prediction interval
[l,u] = \hat{y} \pm q \sqrt{\hat{var}(\hat{y} - y)}
with \hat{y}
as the predicted future observation,
y
as the observed future observations, \sqrt{\hat{var}(\hat{y} - y)}
as the prediction standard error and q
as the bootstrap calibrated coefficient that
approximates a quantile of the multivariate t-distribution.
Please note that this function relies on linear random effects models that are
fitted with lmer()
from the lme4 package. Random effects have to be specified as
(1|random_effect)
.
Value
If newdat
is specified: A data.frame
that contains the future data,
the historical mean (hist_mean), the calibrated coefficient (quant_calib),
the prediction standard error (pred_se), the prediction interval (lower and upper)
and a statement if the prediction interval covers the future observation (cover).
If m
is specified: A data.frame
that contains the number of future observations (m)
the historical mean (hist_mean), the calibrated coefficient (quant_calib),
the prediction standard error (pred_se) and the prediction interval (lower and upper).
If alternative
is set to "lower": Lower prediction limits are computed instead
of a prediction interval.
If alternative
is set to "upper": Upper prediction limits are computed instead
of a prediction interval.
If traceplot=TRUE
, a graphical overview about the bisection process is given.
Examples
# This function is deprecated.
# Please use lmer_pi_unstruc() if you want exactly the same functionality.
# Please use lmer_pi_futmat() or lmer_pi_futvec() if you want to take care
# of the future experimental design