predict.feis {feisr}R Documentation

Predict method for feis models

Description

Predicted values based on linear model object.

Usage

## S3 method for class 'feis'
predict(
  object,
  newdata = NULL,
  se.fit = FALSE,
  vcov = NULL,
  interval = c("none", "confidence", "prediction"),
  level = 0.95,
  pred.var = sigma_sq,
  ...
)

Arguments

object

an object of class "feis", fitted model.

newdata

an optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used.

se.fit

a switch indicating if standard errors are required.

vcov

optional variance-covariance matrix for std.err. calculation.

interval

type of interval calculation.

level

tolerance/confidence level.

pred.var

the variance for future observations to be assumed for prediction intervals. By default, equals the residual variance

...

further arguments.

Details

predict.lm produces predicted values, obtained by evaluating the regression function in the frame newdata (which defaults to model.matrix(object)). If the logical se.fit is TRUE, standard errors of the predictions are calculated. If the vcov is not provided, the object$vcov is used, thus allowing for robust variance-covariance matrices. Setting intervals specifies computation of confidence or prediction (tolerance) intervals at the specified level.

Note: Currently, predictions are based on the transformed (de-trended) data.

Value

A vector of predictions or a matrix of predictions and bounds with column names fit, lwr, and upr if interval is set.

See Also

predict.lm, predict

Examples

feis.mod <- feis(lnw ~ age | exp,
data = mwp, id = "id", robust = TRUE)

new <- data.frame(age = seq(-10, 10, 1))
feis.pred <- predict(feis.mod, newdata = new,
                     se.fit = TRUE, interval = "confidence")

## Not run: 
matplot(new$age, feis.pred$fit, lty = c(1,2,2),
        type = "l", ylab = "predicted y")

## End(Not run)


[Package feisr version 1.3.0 Index]