|
|
|
||||
|
|
|||||
Say you want to predict read from write math science and you want to predict socst from the same variables as well. This is a case where you would want to use sureg. Here is an example.
use http://www.ats.ucla.edu/stat/stata/notes/hsb2, clear
sureg (read write math science) (socst write math science)
------------------------------------------------------------------------------
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
---------+--------------------------------------------------------------------
read |
write | .2376706 .0689943 3.445 0.001 .1024443 .3728968
math | .3784015 .0738838 5.122 0.000 .2335919 .5232111
science | .2969347 .0669546 4.435 0.000 .1657061 .4281633
_cons | 4.369926 3.176527 1.376 0.169 -1.855954 10.59581
---------+--------------------------------------------------------------------
socst |
write | .4656741 .0814405 5.718 0.000 .3060536 .6252946
math | .2763008 .0872121 3.168 0.002 .1053682 .4472334
science | .0851168 .0790329 1.077 0.281 -.0697848 .2400185
_cons | 8.869885 3.749558 2.366 0.018 1.520886 16.21888
------------------------------------------------------------------------------
Now, say that we would like to constrain the write coefficient to be the same for the read and socst dependent variable.
constraint define 1 [read]write = [socst]write
Now, let's run the sureg with this constraint.
sureg (read write math science) (socst write math science), constraint(1)
We can see that indeed the coefficients for write are the same in the two equations.
Seemingly unrelated regression
Constraints:
( 1) [read]write - [socst]write = 0.0
------------------------------------------------------------------
Equation Obs Parms RMSE "R-sq" Chi2 P
------------------------------------------------------------------
read 200 3 6.958168 0.5371 249.6555 0.0000
socst 200 3 8.241349 0.4077 137.9552 0.0000
------------------------------------------------------------------------------
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
---------+--------------------------------------------------------------------
read |
write | .3250833 .0603759 5.384 0.000 .2067487 .4434178
math | .3405605 .0728849 4.673 0.000 .1977087 .4834124
science | .2717817 .0666815 4.076 0.000 .1410884 .402475
_cons | 3.053039 3.15599 0.967 0.333 -3.132587 9.238666
---------+--------------------------------------------------------------------
socst |
write | .3250833 .0603759 5.384 0.000 .2067487 .4434178
math | .3371626 .0843117 3.999 0.000 .1719147 .5024105
science | .1255718 .0778118 1.614 0.107 -.0269364 .27808
_cons | 10.98791 3.674804 2.990 0.003 3.785425 18.19039
------------------------------------------------------------------------------
You might notice that Stata uses listwise deletion for missing data in sureg. If you don't want listwise deletion of missing data, you can use eviews, see
http://www.eviews.com/ for more information.
If you have never used eviews, it is a very unique stat program; it is object oriented instead of procedure oriented. Here is some quick info on doing seemingly unrelated regression in eviews.
First, you open a workfile and you store your data as "objects"; each variable is its own object. Say that you have the variables math_1999 gender_1999 ses_1999 socst_1999 math_2000 gender_2000 ses_2000 socst_2000.
Second, you create a "system" object, which is a system of equations. To do the surreg you described, the system would look like this. Say that you call the system "hsb".
math_1999=c(1)+c(2)*gender_1999+c(3)*ses_1999+c(4)*socst_1999
math_2000=c(6)+c(2)*gender_2000+c(3)*ses_2000+c(4)*socst_2000
Note that c(1) is the constant, and c(2) is the coefficent for gender (1999 and 2000) and c(3) is the coefficient for ses, and c(4) is the coeficient for socst. When the c(x) is the same, you are constraining the coefficients to be the same.
You can "run" this system, and tell it that you want to use "sur" as the estimation technique, or you can write a program (see below) and run the program
output(t) "c:\temp\results.txt"
hsb.sur(p)
output off
Note that the "hsb.sur" means to run the "hsb" system with the "sur" estimation technique.
UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services