Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Creating a column from point estimates across observations


From   "Sohini Sahu" <ss435568@albany.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Creating a column from point estimates across observations
Date   Sat, 6 Jun 2009 13:45:49 -0400 (EDT)

I have a question as to how to do the following:

I have written a procedure that does a restricted regression on the
variables I supply. Say I regress income on wages and capital expenditure.
Say this is done 15 times, each time for one industry.

The program reads like this:
------------------------------------------------------
capture program drop reg1
program define reg1
syntax varlist(numeric min=1) [if]
marksample tin
* tin is a temporary variable that returns value 1 if the if condition is
satisfied


	regress score `1' if `tin'

                  gen a=_b[`1']
display "a" a

drop a



end

reg1 w k if cid=="C1"
reg1 w k if cid=="C2"

*C1 stands for Industry 1 etc.
-------------------------------------------------------------------------

What I want is one single column that would have the coefficients of wages
across all industries and another column that would have the coefficients
for capital expenditure across all industries.

I have done it in a longer way, but was wondering how to do it within a
procedure.

Thank you.

SS
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index