Learn R Programming

REndo (version 2.4.3)

predict.rendo.latent.IV: Predict method for Models using the Latent Instrumental Variables approach

Description

Predicted values based on linear models estimated using the latent instrumental variables approach for a single endogenous regressor.

Usage

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

Arguments

object

Object of class inheriting from "rendo.latent.IV"

newdata

An optional data frame 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.latent.IV produces a vector of predictions

See Also

The model fitting function latentIV

Examples

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

lat  <- latentIV(y ~ P, data = dataLatentIV)

# returns the fitted values
predict(lat)

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

# }

Run the code above in your browser using DataLab