On Sun, 8 Jan 2012, Sung Jin Lim wrote:

> Thank you for answer
>
> I have checked the again my estimation procedure...
> and I noticed that there is the some mistake in AIDS case...
> that means that the estimated coefficients of AIDS model regressed by GRETL
> has the same coefficient...
> It is almost same in the 4th digit.
>
>
> But the Rotterdam Case...I am not sure..
> maybe there is a mistake on the estimation...method...I lost my confidence
> on it
> anyway..following is the code I wrote
> and I attached the data
[...]

I tried your script using gretl and R (R 2.14.1 with systemfit 
1.1-10). The results were essentially the same. Here is my script:

<hansl>
open book8.xls

genr DivisiaQ = sw1*dq1 +  sw2*dq2 +  sw3*dq3 +  sw4*dq4
genr wdq1 = sw1*dq1
genr wdq2 = sw2*dq2
genr wdq3 = sw1*dq3
genr wdq4 = sw2*dq4

genr ddp1=dp1-dp4
genr ddp2=dp2-dp4
genr ddp3=dp3-dp4

system name="Rotterdam"
   equation wdq1 DivisiaQ ddp1 ddp2 ddp3
   equation wdq2 DivisiaQ ddp1 ddp2 ddp3
   equation wdq3 DivisiaQ ddp1 ddp2 ddp3
end system

# Unrestricted estimation
estimate "Rotterdam" method=sur

restrict "Rotterdam"
   b[1,3] - b[2,2] = 0
   b[1,4] - b[3,2] = 0
   b[2,4] - b[3,3] = 0
end restrict

# Restricted estimation, iterated
estimate "Rotterdam" method=sur --iterate

foreign language=R --send-data
   library(systemfit)
   e1 <- wdq1 ~ 0 + DivisiaQ + ddp1 + ddp2 + ddp3
   e2 <- wdq2 ~ 0 + DivisiaQ + ddp1 + ddp2 + ddp3
   e3 <- wdq3 ~ 0 + DivisiaQ + ddp1 + ddp2 + ddp3
   system <- list(e1, e2, e3)

   # Unrestricted estimation
   fit1 <- systemfit(system, method="SUR")
   print(summary(fit1))

   R <- matrix(0,3,12)
   q <- matrix(0,3,1)

   R[1,3] <-  1
   R[1,6] <- -1
   R[2,4] = 1
   R[2,10] = -1
   R[3,8] = 1
   R[3,11] = -1

   # Restricted estimation, iterated
   fit2 <- systemfit(system, method="SUR", restrict.matrix=R,
      restrict.rhs=q, maxiter=80)
   print(summary(fit2))
   lrtest(fit2, fit1)
end foreign
</hansl>

The one thing that seems like a bug in gretl is that you're able to 
estimate the "Rotterdam" system using 3SLS without generating an 
error, since you have not specified any instruments. I'll look into 
that. (Gretl seems to be falling back to consider all the regressors 
as exogenous, but that seems too lax.)

Allin Cottrell

Reply via email to