Nothing
residuals.ivmodel <- function(object, ...){
ivmodel <- object
temp <- matrix(NA, nrow=2, ncol=0)
if(!is.null(ivmodel$kClass)){
temp<-rbind(as.numeric(rownames(ivmodel$kClass$ci)), c(ivmodel$kClass$point.est))
colnames(temp) <- paste("k=", temp[1,], sep="")
colnames(temp)[temp[1,]==0] <- "OLS"
colnames(temp)[temp[1,]==1] <- "TSLS"
}
if(!is.null(ivmodel$LIML)){
LIML <- c(ivmodel$LIML$k, ivmodel$LIML$point.est)
temp <- cbind(temp, LIML)
}
if(!is.null(ivmodel$Fuller)){
Fuller <- c(ivmodel$Fuller$k, ivmodel$Fuller$point.est)
temp <- cbind(temp, Fuller)
}
result <- matrix(NA, ncol=ncol(temp), nrow=ivmodel$n)
colnames(result) <- colnames(temp)
for(i in 1:ncol(temp)){
result[, i] <- ivmodel$Yadj - temp[2, i]*ivmodel$Dadj
}
# NA handling
output = matrix(NA, ncol=ncol(temp), nrow=length(ivmodel$naindex))
colnames(output) <- colnames(temp)
output[which(ivmodel$naindex), ] = result
return(output)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.