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

Description Usage Arguments Value See Also Examples

View source: R/f_s3_rendolatentIV.R

Description

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

Usage

1
2
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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 Sept. 5, 2021, 5:37 p.m.