SWAMY Procedure |
@SWAMY implements the Swamy random coefficients estimator from Swamy(1970). @MEANGROUP is a similar procedure which does pooled mean group (equally-weighted) estimates.
@SWAMY( options ) depvar start end
# list of regressors (in regression format)
Parameters
|
depvar |
dependent variable |
|
start, end |
range for regression. By default, the maximum range permitted by all variables involved in the regression. |
Options
DELTA=covariance matrix of beta(i)-beta [estimated from data]
SMPL=standard SMPL option [none]
[PRINT]/NOPRINT
TITLE="title for output" ["Pooled Mean Group"]
DEFINE=equation to define [none]
Variables Defined
|
%BETA |
estimates of mean of coefficient process (VECTOR) |
|
%XX |
estimates of covariance matrix of mean coefficient (SYMMETRIC) |
|
%%IBETAS |
individual coefficients (VECT[VECTOR]). %%IBETAS(i) is the coefficient vector for individual i. |
|
%%IXX |
individual covariance matrices (VECT[SYMMETRIC]). %%IXX(i) as the covariance matrix for individual i |
Example
*
* Greene, Econometric Analysis, 7th Edition
* Example 11.19 from p. 418-419
*
open data produc_fix.prn
calendar(panelobs=17,a) 1970:1
data(format=prn,org=columns,left=3) 1//1970:01 48//1986:01 yr p_cap hwy water util pc gsp emp unemp
*
* Log all variables except unemp
*
dofor s = gsp p_cap hwy water util pc emp
log s
end dofor
*
linreg gsp
# constant pc hwy water util emp unemp
@swamy gsp
# constant pc hwy water util emp unemp
Sample Output
This shows the output from the LINREG (OLS) and @SWAMY.
Linear Regression - Estimation by Least Squares
Dependent Variable GSP
Panel(17) of Annual Data From 1//1970:01 To 48//1986:01
Usable Observations 816
Degrees of Freedom 809
Centered R^2 0.9930534
R-Bar^2 0.9930018
Uncentered R^2 0.9999351
Mean of Dependent Variable 10.508849637
Std Error of Dependent Variable 1.021131864
Standard Error of Estimate 0.085422808
Sum of Squared Residuals 5.9033184420
Regression F(6,809) 19275.0232
Significance Level of F 0.0000000
Log Likelihood 853.1372
Durbin-Watson Statistic 0.1877
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant 1.926004375 0.052503182 36.68357 0.00000000
2. PC 0.312023086 0.011087500 28.14188 0.00000000
3. HWY 0.058881719 0.015411448 3.82065 0.00014330
4. WATER 0.118580557 0.012356570 9.59656 0.00000000
5. UTIL 0.008555123 0.012354029 0.69250 0.48882423
6. EMP 0.549695456 0.015536879 35.38004 0.00000000
7. UNEMP -0.007270503 0.001383632 -5.25465 0.00000019
Linear Regression - Estimation by Swamy Random Coefficients
Dependent Variable GSP
Panel(17) of Annual Data From 1//1970:01 To 48//1986:01
Usable Observations 816
Degrees of Freedom 809
Mean of Dependent Variable 10.508849637
Std Error of Dependent Variable 1.021131864
Standard Error of Estimate 0.212964578
Sum of Squared Residuals 36.691314502
Durbin-Watson Statistic 0.1235
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant 1.653077991 1.083313374 1.52595 0.12702325
2. PC 0.094075492 0.051516152 1.82614 0.06782980
3. HWY 0.105011432 0.173640565 0.60476 0.54533632
4. WATER 0.076718921 0.067427329 1.13780 0.25520335
5. UTIL -0.014902110 0.098864318 -0.15073 0.88018638
6. EMP 0.919059423 0.104448623 8.79915 0.00000000
7. UNEMP -0.004705473 0.002067306 -2.27614 0.02283775
Copyright © 2025 Thomas A. Doan