search for: iprobit

Displaying 1 result from an estimated 1 matches for "iprobit".

Did you mean: probit
2009 Jul 01
0
probit with sample selection error?
...it equation Thanks much Codes: require(mvtnorm) obs=1000 sig=matrix(c(1,0.7,0.7,1),2,2) mu=c(0,0) e = rmvnorm(obs,mu,sig); x1 = rnorm(obs);x2=rnorm(obs);x3=rnorm(obs); y1 = as.integer(1+2*x1-2*x2+e[,1]>0) y2 = as.integer(0.2-2*x2+x3+e[,2]>0) x1 = cbind(1,x1,x2); x2 = cbind(1,x2,x3) iprobit<-function(y,x){ bstart = solve(qr(x),y) b=optim(bstart,probll,y=y,x=x,hessian=F)$par return(b) } probll<-function(bstart,y,x){ prob=pnorm(x%*%bstart); ll= -sum(y*log(prob)+(1-y)*log(1-prob)); return(ll) } heckprob<-function(y1,x1,y2,x2){ bstart = as.vector(c(iprobit(y1,x1),iprobit(y2,x2)...