/* ** maxlik7.e - A bootstrapped 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; rndseed 787889; output file = maxlik7.out reset; __title = "tobit example"; __output = 10; x0 = { 1, 1, 1, 1 }; {x,f,g,cov,ret} = MAXLIK("tobit",0,&lpr,x0); call maxprt(x,f,g,cov,ret); _max_BootFname = "mboot7"; call MAXboot("tobit",0,&lpr,x); __title = "confidence limits from bootstrapped coefficients"; cl = MAXBLimits("mboot7"); call MAXCLPrt(x,f,g,cl,ret); printdos "\n MAXBoot has created the GAUSS data file `mboot7'\n"; printdos " containing the bootstrapped coefficients. You may\n"; printdos " want to delete this file after the program has been run\n\n"; "press any key for kernel density plots..."; call keyw; call MAXdensity("boot7",0); printdos "\n"; printdos "Press any key for histogram and surface plots..."; call keyw; call MAXhist("boot7",0); output off;