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

View source: R/f_s3_rendolatentIV.R

predict.rendo.latent.IVR Documentation

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 class '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

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


REndo documentation built on July 3, 2024, 1:06 a.m.