PROC(0)=wrtpt(b,v,vof,dset,met,yname,iname,xnames,n);
local i,x,chi,y,mask,fmt,e,metstr;

x=b~sqrt(diag(v))~(b./sqrt(diag(v)));

metstr="unknown";
if met==-3; metstr="Broyden-Fletcher-Goldfarb-Shanno (BFGS) Method";
elseif met==-2; metstr="Polak-Ribiere Conjugate Gradient Method";
elseif met==-1; metstr="Powell's Method";
elseif met==0;  metstr="Simplex Method";
endif;



let mask[1,3]= 1 1 1 ;
let fmt[3,3]=
    "#*.*lG" 11 4
    "#*.*lG" 11 4
    "#*.*lG " 11 4;

print /flush  "                                 ";
print /flush  "                                 ";
print /flush  "                                 ";
? "                PANEL DATA TOBIT ESTIMATION   ";
print /flush  "                                 ";
? "                  estimate    st.dev.     t-stat";
print /flush  "                                 ";
i=1;
do while i<=rows(x);
print /ld $xnames[i];;
   y=printfm(x[i,.],mask,fmt); " ";
i=i+1;
endo;

print /flush  "                                 ";
chi=b'*inv(v)*b;
format/rd 7,0;
"Data set:                 ";; $dset;
"Dependent variable:       ";;$yname; 
"Identification variable:  ";;$iname;
"Number of Observations = ";; n;
if (_ptloss.eq 1); "Quadratic Loss Function                       ";; endif;
if (_ptloss.eq 2); "Absolute Value Loss Function                  ";; endif;
if (_ptloss.eq 3); "Polynomial Loss Function (theta = " ;; _pttheta;; ").  ";;
endif;
format /m0/rd 7,3;
"    Function Value: ";;vof;
"Optimization method:      ";;$metstr;
"Chi-square test for joint significance:";;
format /rd 8,1; chi;; format /rd 5,1; "  (p-value="
int(1000*cdfchic(chi,rows(x)))/10;; "%)        ";;
print /flush  "                                 ";

ENDP;

