/* ** maxlik11.e - profile of a Tobit model ** */ library maxlik,pgraph; #include maxlik.ext; #include pgraph.ext; graphset; maxset; proc lpr(x,z); local s,m,u; s = x[4]; if s <= 0; retp(error(0)); endif; m = z[.,2:4]*x[1:3,.]; u = z[.,1] ./= 0; retp(u.*lnpdfn2(z[.,1]-m,s) + (1-u).*(ln(cdfnc(m/sqrt(s)))) ); endp; x0 = { 1, 1, 1, 1 }; __title = "tobit example"; output file = maxlik11.out reset; __output = 5; _max_Select = { 2 }; {x,f,g,cov,ret} = maxprofile("tobit",0,&lpr,x0); output off;