lmer_pi function

Prediction intervals for future observations based on linear random effects models (DEPRECATED)

Prediction intervals for future observations based on linear random effects models (DEPRECATED)

This function is deprecated. Please use lmer_pi_unstruc(), lmer_pi_futvec() or lmer_pi_futmat().

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 "lmerMod"
  • newdat: a data.frame with the same column names as the historical data on which the model depends
  • m: number of future observations
  • alternative: either "both", "upper" or "lower". alternative specifies if a prediction interval or an upper or a lower prediction limit should be computed
  • alpha: defines the level of confidence (1-alpha)
  • nboot: number of bootstraps
  • lambda_min: lower start value for bisection
  • lambda_max: upper start value for bisection
  • traceplot: if TRUE: plot for visualization of the bisection process
  • n_bisec: maximal number of bisection steps

Returns

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.

Details

This function returns a bootstrap calibrated prediction interval

[l,u]=y^±qvar^(y^y) [l,u] = \hat{y} \pm q \sqrt{\hat{var}(\hat{y} - y)}

with y^\hat{y} as the predicted future observation, yy as the observed future observations, var^(y^y)\sqrt{\hat{var}(\hat{y} - y)}

as the prediction standard error and qq 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).

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
  • Maintainer: Max Menssen
  • License: GPL (>= 2)
  • Last published: 2024-03-04