I noticed that for the one-way unbalanced random effect model with the Swamy-Arora method, the results given by EViews 9.5 diverge from the values printed in text book of Baltagi (2013), table 9.1 (Hedonic housing data), e.g. the coefficient for variable 'crim' is -0.72 in the text book but -0.74 in EViews.
The data is commonly used in text book literature and examples, even in the EViews documentation for panel data here: http://www.eviews.com/help/helpintro.ht ... mples.html
But in this example, only the Wallace-Hussien method is used (which corresponds to the text book numbers), not Swamy-Arora.
EDIT
EViews replicates the numbers in table 2 of Baltagi/Chang (1994), column SA. Table 9.1 in the current text book of Baltagi (3rd+ editions) claims to be a copy of that table from the paper, but, in fact, it isn't an exakt copy because the numbers in column SA have been changed silently.
END EDIT
So, what is reason for the difference for the Swamy-Arora method?
Is it a bug in EViews? Wrong numbers in the text book? Please note: Stata seems to replicate Baltagi's figures as there is also example output of Stata in the text book
one-way unbalanced random effect model
Moderators: EViews Gareth, EViews Moderator
-
- EViews Developer
- Posts: 2672
- Joined: Wed Oct 15, 2008 9:17 am
Re: one-way unbalanced random effect model
I don't know why the third edition of Baltagi has different numbers. EViews matches the numbers in Baltagi 2 and (without going back and looking myself) from what you say, the numbers from the original paper.
From all of that and the fact that Stata matches the book, my best guess is that Stata was used to obtain the SA results in Table 9.1, but I want to emphasize that this is only a guess. Alternately, there may have been a revision in the suggested procedure since we implemented the procedure, and if so, we'd certainly look into it, but as of now, we are computing the SA and matching results as in Baltagi 2.
From all of that and the fact that Stata matches the book, my best guess is that Stata was used to obtain the SA results in Table 9.1, but I want to emphasize that this is only a guess. Alternately, there may have been a revision in the suggested procedure since we implemented the procedure, and if so, we'd certainly look into it, but as of now, we are computing the SA and matching results as in Baltagi 2.
Re: one-way unbalanced random effect model
Well, the desription of the method has not been changed. But the numbers.
The sentence below formula (9.20) is only true if one takes the u^b residuals to stem from the "full length" between regression ("Note that u^b' * P * u^b can be obtained as the OLS residual sum of squares from the regression involving sqrt(T_i) * yb_i on sqrt(T_i) * Zb_i"). Maybe this is the reason?
Here is some R code to demonstrate It calculates the quantity u^b' * P * u^b in the differnent ways:
What do you think?
The sentence below formula (9.20) is only true if one takes the u^b residuals to stem from the "full length" between regression ("Note that u^b' * P * u^b can be obtained as the OLS residual sum of squares from the regression involving sqrt(T_i) * yb_i on sqrt(T_i) * Zb_i"). Maybe this is the reason?
Here is some R code to demonstrate It calculates the quantity u^b' * P * u^b in the differnent ways:
What do you think?
Code: Select all
library(plm)
data(Grunfeld)
pG <- Grunfeld[1:199, ] # make it unbalanced
# estimate between model, just to get the between transformation of the data and the residuals
mod1 <- plm(inv ~ value + capital, model = "between", data = pG)
Xb <- model.matrix(mod1)
yb <- pmodel.response(mod1)
XB <- model.matrix(mod1, model = "Between") # "full length" data
yB <- pmodel.response(mod1, model = "Between") # "full length" data
pdim <- pdim(pG) # get dimensions
XbTi <- sqrt(pdim$Tint$Ti) * Xb
ybTi <- sqrt(pdim$Tint$Ti) * yb
print(sum(lm.fit(XbTi, ybTi)$residuals^2), digits = 15) # 1012046.85102916
print(sum(mod1$residuals^2 * pdim$Tint$Ti), digits = 15) # 1012046.89823139
print(sum(lm.fit(XB, yB)$residuals^2), digits = 15) # 1012046.85102916
## unbalanced
JTi <- lapply(pdim$Tint$Ti, function(x) matrix(rep(1, x^2), x))
JTib <- mapply(function(x, y) x / y, JTi, pdim$Tint$Ti)
P <- Matrix::bdiag(JTib) # 199 x 199
resid_full_length <- mod1$residuals[as.character(index(mod1)[[1]])] # length: 199 in unbalanced case
print(as.vector(resid_full_length %*% P %*% resid_full_length), digits = 15) # 1012046.89823139 - matches Ti-weighted squared residuals
print(as.vector(lm.fit(XB, yB)$residuals %*% P %*% lm.fit(XB, yB)$residuals), digits = 15) # 1012046.85102916 - matches sum of squared residuals of OLS with Ti-weigted data
Last edited by Gude on Thu Jun 29, 2017 4:45 am, edited 1 time in total.
-
- EViews Developer
- Posts: 2672
- Joined: Wed Oct 15, 2008 9:17 am
Re: one-way unbalanced random effect model
At this point, I think your issue is with the results in Baltagi and not with EViews. I'm not sure I can answer for the author.
Who is online
Users browsing this forum: No registered users and 27 guests