/* ** maxlik3.e - A Tobit Model ** ** Computes heteroskedastic-consistent covariance matrix ** of parameters. ** */ library maxlik; #include maxlik.ext; maxset; proc lpr(x,z); local t,s,m,u; s = x[4]; if s <= 0; retp(error(0)); endif; m = z[.,2:4]*x[1:3,.]; u = z[.,1] ./= 0; t = z[.,1]-m; retp(u.*(-(t.*t)./(2*s)-.5*ln(2*s*pi)) + (1-u).*(ln(cdfnc(m/sqrt(s)))) ); endp; x0 = { 1, 1, 1, 1 }; output file = maxlik3.out reset; _max_Options = { hetcon }; call maxprt(maxlik("tobit",0,&lpr,x0)); print; print "information matrix v-c of par's"; print _max_HessCov; print; print "cross product v-c of par's"; print _max_XprodCov; output off;