predict.rrma: Predict method for robust meta-regression fits

Description Usage Arguments Details Value Author(s) References Examples

View source: R/predict.rrma.R

Description

predict.rrma returns predicted values and error from robust variance meta-regression models

Usage

1
2
3
  predict.rrma(object, newdata = NULL, se.fit = FALSE,
    na.action = na.pass, level = 0.95,
    interval = c("none", "confidence"))

Arguments

object

A meta-regression object of class rrma

newdata

Optional new data frame

se.fit

A switch indicating if standard errors are required.

na.action

function determining what should be done with missing values in newdata. The default is to predict NA.

level

Tolerance/confidence interval

interval

Return a confidence interval?

Details

predict.rrma is used to generate new predicted variables and error from a data set. Note that incorporating study and data point level variation is not yet implemented.

Value

For prediction without standard errors: a vector with predicted values; for prediction with standard errors: a list with predicted values and standard error values; four prediction with confidence intervals: a data frame with the column names fit, lwr, upr.

Author(s)

Jarrett Byrnes and Sean Anderson

References

Hedges, L.V., Tipton, E. & Johnson, M.C. (2010). Robust variance estimation in meta-regression with dependent effect_size estimates. Res. Synth. Method., 1, 39-65.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(broad)
m <- rrma(formula = lnorReg ~ d18OresidualMean.cent, data =
broad, study_id = study.ID, var_eff = vlnorReg, rho = 0.5)

pred <- predict(m, interval = "confidence")

plot(lnorReg ~ d18OresidualMean.cent, data=broad)
matplot(broad$d18OresidualMean.cent, pred$fit, col="red", lwd=2,
add=TRUE, type="l")
idx <- sort(broad$d18OresidualMean.cent, index.return=TRUE)$ix
polygon(c(broad$d18OresidualMean.cent[idx],
rev(broad$d18OresidualMean.cent[idx])), c(pred$lwr[idx],
rev(pred$upr[idx])), col = "#00000020", border = NA)

seananderson/robustmeta documentation built on May 29, 2019, 4:25 p.m.