Learn R Programming

REndo (version 2.4.3)

predict.rendo.ivreg: Predict method for fitted Regression Models with Internal Instrumental Variables

Description

Predicted values based on model objects fitted using the instrumental variables regression fitted with IVs generated from the data.

Usage

# S3 method for rendo.ivreg
predict(object, newdata, ...)

Arguments

object

Object of class inheriting from "rendo.ivreg"

newdata

An optional data frame without any instrumental variables in which to look for variables with which to predict. If omitted, the fitted values are returned.

...

ignored, for consistency with the generic function.

Value

predict.rendo.ivreg produces a vector of predictions

See Also

The model fitting functions hetErrorsIV, higherMomentsIV.

Examples

Run this code
# NOT RUN {
data("dataHetIV")

het <- hetErrorsIV(y~X1+X2+P|P|IIV(X1, X2),
                   data = dataHetIV)

# returns the fitted values
predict(het)

# using the data used for fitting also for predicting,
# correctly results in fitted values
all.equal(predict(het, dataHetIV), fitted(het)) # TRUE

# }

Run the code above in your browser using DataLab