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