/* ** maxlik2.e - The Tobit Model ** ** This example illustrates a different method for computing the ** Tobit function in which MAXLIK will have to be forced to pass ** the data one observation at a time. This example produces the ** the same results as MAXLIK1.E. */ library maxlik; #include maxlik.ext; proc lpr(x,z); local s,m; s = x[4]; m = z[.,2:4]*x[1:3,.]; if z[.,1]; retp(lnpdfn2(z[.,1]-m,s)); else; retp(ln(cdfnc(m/sqrt(s)))); endif; endp; maxset; x0 = { 1 1 1 1 }; __title = "tobit example"; __row = 1; __output = 5; output file = maxlik2.out reset; call maxprt(maxlik("tobit",0,&lpr,x0)); output off;