22
Stata Technical Bulletin
STB-33
Swamy (1970, 1971) further points out that the matrix Γ may not be positive definite and that since the second term is of
order l∕(rnT), it is negligible in large samples. A simple and asymptotically expedient solution is to simply drop this second
term and instead use
f=i⅛(∑⅛⅝-'"w)
As a test of the model, we may look at the difference between the OLS estimate of β ignoring the panel structure of the
data and the matrix-weighted average of the panel-specific OLS estimators. The test statistic suggested by Swamy (1970, 1971)
is given by
m Γ m ^∣ - ɪ m
λ‰-D=∑[3i-3*]'V-1[¾-r] where Г = λJ ∑Σ¾
i=l Li=I J i=l
Johnston (1984) has shown that the test is algebraically equivalent to testing
Яо : ∕31 — ∕32 — ∙ ∙ ∙ — βm
in the generalized (groupwise heteroscedastic) xtgls model where V is block diagonal with ith diagonal element ГЦ.
xtrchh is an implementation of the random coefficients model (including the test of parameter constancy) with syntax
given by
xtrchh depvar Vvrι^liti∖ [if exp∖ [in range∖ [, VOvcamamei) V(Vaanemet) level(#) ]
Options
v(r`aniame's specifies the variable that contains the unit to which the observation belongs. You can specify the i() option the
first time you estimate or use the iis command to set i() beforehand. After that, Stata will remember the variable’s
identity. See [R] xt in the Stata 5.0 Reference Manual.
v(ramemes specifies the variable that contains the time at which the observation was made. You can specify the t() option
the first time you estimate or use the tis command to set t() beforehand. After that, Stata will remember the variable’s
identity.
level (#) specifies the confidence level, in percent, for confidence intervals. The default is level (95) or as set by set level.
Example
Greene (1993, 445) reprints data in a classic study of investment demand by Grunfeld and Griliches (1960). In the Stata
manual, we use this data to illustrate many of the possible models that may be estimated with the xtgls command. While the
models included in the xtgls command offer considerable flexibility, they all assume that there is no parameter variation across
firms (the cross-sectional units).
In order to take a first look at the assumption of parameter constancy, we might reshape our data so that we may estimate
a simultaneous equation model using sureg. Since there are only 5 panels here, it is not too difficult.
. reshape groups company 1-5
. reshape vars invest market stock time
. reshape cons c
. reshape wide
. eq cl : investi marketl stockl
. eq c2 : invest2 market2 stock2
. eq c3 : invest3 market3 stock3
. eq c4 : invest4 market4 stock4
. eq cδ : investδ marketδ stockδ