pred_int: Prediction interval for different objects

Description Usage Arguments Details Value Examples

View source: R/pred_int.R

Description

Prediction interval for a variety of objects in the context of random-effects meta-analysis

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
pred_int(
  x,
  interval = c("prediction", "confidence"),
  method = c("tdist", "tdist2", "boot", "mcmc", "simulate", "predict", "metafor",
    "ntrial", "conformal"),
  m.method = c("REML", "DL", "HE", "SJ", "ML", "REML", "EB", "HS", "GENQ"),
  c.method = c("quantile", "deviation", "jackknife"),
  degfr = c("default", "zdist", "kr"),
  level = 0.95,
  nsim = 500,
  var.names = NULL,
  formula = NULL,
  ...
)

Arguments

x

should be an object of class: "numeric", "data.frame", "lmerMod" or "MCMCglmm"

interval

type of interval with default 'prediction'

method

either 'tdist', 'tdist2', 'boot', 'mcmc', 'simulate', 'predict', 'metafor', 'ntrial' or 'conformal'.

m.method

method for between-trial variance estimator (used in the 'metafor' package)

c.method

method for conformal prediction. See ?pred_int_conformal

degfr

degrees of freedom method default (n.k-2), zdist ("Inf") or "kr" (Kenward-Roger). see package 'emmeans'

level

coverage level with default 0.95

nsim

number of simulations for the 'boot' method.

var.names

variable names to be passed to the 'data.frame' methods

formula

formula interface for 'data.frame' methods

...

arguments to be passed to a few of the functions

Details

This function will calculate a prediction interval in the context of meta-analysis As defined in Higgins et al. (2009) it considers the parameteric uncertainty and the between study uncertainty, but there is more to this... Implemented cases:

object of class 'numeric'
object of class 'lmerMod'
object of class 'MCMCglmm'
object of class 'data.frame'

For object of class numeric method t-dist is based on the 'lm' function and predict There is also a method based on conformal prediction. See 'pred_int_conformal'

For object of class 'lmerMod' there are three methods:
- tdist
- tdist2
- boot (uses lme4::bootMer)

For object of class 'MCMCglmm' there are four methods:
- tdist
- mcmc
- simulate
- predict

There is also the 'ntrial' method, which needs to be applied to a data.frame. It uses 'MCMCglmm'

Another method 'pred_int_metafor' uses the metafor pacakge And it also requires a data.frame

the degrees of freedom argument (degfr) allows for different methods other than n.k-2 Calculate prediction intervals for a variety of objects

The main reference to understand the rationale behind this function is
Higgins et al. (2009) A re-evaluation of random-effect meta-analysis

Value

a prediction interval for a "new_trial"

Examples

1
2
3
4
5
6
7
8
## Not run: 
## Using soybean row spacing
data(soyrs)
fit <- lmer(lrr ~ 1 + (1|Trial_ID), data = soyrs)
pdi <- pred_int(fit)
pdi 

## End(Not run)

femiguez/predintma documentation built on July 5, 2021, 4:16 a.m.