View source: R/f_s3_rendolatentIV.R
predict.rendo.latent.IV | R Documentation |
Predicted values based on linear models estimated using the latent instrumental variables approach for a single endogenous regressor.
## S3 method for class 'rendo.latent.IV'
predict(object, newdata, ...)
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. |
predict.rendo.latent.IV
produces a vector of predictions
The model fitting function latentIV
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.