/* {b,v,f}=twoside(dat,_met); DESCRIPTION Implements the estimator for a panel data regression model proposed in Honore and Leth-Petersen. The weights are 1/T(i). The file optmum.prc must be in the same directory. INPUT dat (NxK) matrix. Each row represens an observation. The first column contains the dependent variable. The second colums contains the individual id. Column 3-K contain the time-varyind explanatory variables. _met Optimization method. The allowable values are 0 Amoeba -1 Powell's method -2 frpmin -3 dfpmin OUTPUT b Estimate v Estimted Variance-matrix f Function Value */ #include beh_slp.gau; /* Generate fake data */ n=200; beta=1|0|2; k=rows(beta); dat=zeros(1,k+2); i=1; do while i<=n; a=rndn(1,1)/3+0.5; no=int((rndu(1,1).^2)*8+1); ii=zeros(no,1)+i; x=rndn(no,k)/3; y=0+a+x*beta+rndn(no,1)/3; y=y.*(y.>0); y=1-y; y=y.*(y.>0); y=1-y; dat=dat|(y~ii~x); i=i+1; endo; dat=dat[2:rows(dat),.]; /* estimation */ cls; #include beh_slp.gau; {b,v,f}=twoside(dat,0); /* print out results */ se=sqrt(diag(v)); t=(b-0)./se; " RESULTS"; format /rd 15,3; " "; " coefficient estimate std.err. t-stat"; for i (1,rows(b),1); i~b[i]~se[i]~t[i]; endfor;