| predict.feis | R Documentation |
Predicted values based on linear model object.
## 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,
...
)
object |
an object of class " |
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. |
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.
A vector of predictions or a matrix of predictions and bounds with column names
fit, lwr, and upr if interval is set.
predict.lm, predict
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.