/*************************************
  SOUTH AFRICA;  March 1999
  GAUSS programs
  Regressions for IMF SP  Table 3

  Tariff reductions and TPP growth
  Subperiods 1990-94, 1994-98
**************************************/

load dat[48,29] = datapool.txt;
timeper = 2;   /* timeper = 1   if 1990-94 */
               /* timeper = 2   if 1994-98 */

_output = 1;
_olsres = 1;
if timeper == 1;        i = 1; j = 24;  output file = Table3a.out reset;
elseif timeper == 2;    i =25; j = 48;  output file = Table3b.out reset;
endif;
"
SUBPERIDOS: (Pooled dataset), TFPgr
======================================";
if timeper == 1;        "Subperiod 1: 1990-94";
elseif timeper == 2;    "Subperiod 2: 1994-98";
endif;
"
TFPgr against const clr ex im t tsq tch tchsq
------------------------------------------------------";
x = dat[i:j,3 1 4 8 9 12 17 13 18];
__altnam = "CLR"|"Exp"|"Imp"|"Tariff"|"Tariffsq"|"Tariffch"|
"Tchsq"|"TFPgr";
{ vnam,m,b,stb,vc,stderr,sigma,cx,rsq,resid,dwstat } =
              ols(0,x[.,1],x[.,2:cols(x)]);
{b,covb,ehat}=mygmm1(x[.,1],x[.,2:cols(x)],1,0);

"
TFPgr against const clr ex im tch tchsq
------------------------------------------------------";
x = dat[i:j,3 1 4 8 9 13 18];
__altnam = "CLR"|"Exp"|"Imp"|"Tariffch"|"Tchsq"|"TFPgr";
{ vnam,m,b,stb,vc,stderr,sigma,cx,rsq,resid,dwstat } =
              ols(0,x[.,1],x[.,2:cols(x)]);
{b,covb,ehat}=mygmm1(x[.,1],x[.,2:cols(x)],1,0);

if timeper == 2;
"
TFPgr against const dum clr ex im tch tchsq tchlag tchsqlag
----------------------------------------------------------------------";

x = dat[i:j,3 1 4 8 9 13 18]~dat[1:24,13 18];
__altnam = "CLR"|"Exp"|"Imp"|"Tch"|"Tchsq"|"Tchlag"|"Tchsqlag"|"TFPgr";
{ vnam,m,b,stb,vc,stderr,sigma,cx,rsq,resid,dwstat } =
              ols(0,x[.,1],x[.,2:cols(x)]);
{b,covb,ehat} = mygmm1(x[.,1],x[.,2:cols(x)],1,0);

"
TFPgr against const clr ex im tch tchsq DGEIS
------------------------------------------------------";
x = dat[i:j,3 1 4 8 9 13 18 29];
__altnam = "CLR"|"Exp"|"Imp"|"Tariffch"|"Tchsq"|"DGEIS"|"TFPgr";
{ vnam,m,b,stb,vc,stderr,sigma,cx,rsq,resid,dwstat } =
              ols(0,x[.,1],x[.,2:cols(x)]);
{b,covb,ehat}=mygmm1(x[.,1],x[.,2:cols(x)],1,0);

endif;

output off;



