R/fitted.ivmodel.r

Defines functions fitted.ivmodel

Documented in fitted.ivmodel

fitted.ivmodel <- function(object, ...){
  ivmodel <- object
  residual_est =  resid(ivmodel)
  stopifnot("Number of estimated residuals do not equal number of outcome"= nrow(residual_est) == nrow(ivmodel$Y))
  
  result = matrix(ivmodel$Y,nrow(residual_est),ncol(residual_est)) - residual_est
  result = result[which(ivmodel$naindex),]
  return(result)
}

Try the ivmodel package in your browser

Any scripts or data that you put into this service are public.

ivmodel documentation built on April 9, 2023, 5:08 p.m.