Learn R Programming

REndo (version 2.4.10)

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, ...)

Value

predict.rendo.ivreg produces a vector of predictions

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.

See Also

The model fitting functions hetErrorsIV, higherMomentsIV.

Examples

Run this code
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