Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Create variable from regression coefficients in panel databases
From
"Veronica Escudero" <[email protected]>
To
<[email protected]>
Subject
st: Create variable from regression coefficients in panel databases
Date
Wed, 07 Aug 2013 10:36:43 +0200
Dear Statalist,
I would like to create a variable with the regression coefficients of
my regression so I can use it for further analysis, but I'm having
trouble doing that for the panel of 32 countries with 20 year
information for each of them. What I would like to do is this:
1. Run a simple OLS reg but not on the overall sample but rather by
country (the idea would be to have one coefficient per country)
2. Capture the country-specific coefficients of my independent variable
3. Build a variable with those coefficients.
I've tried to use some of the recommendations posted already in
Statalist, but didn't manage to do exactly what I wanted.
I tried for example:
- gen var = _b[gr_gdp] // after running the regression by country. But
this collects the coefficient of the last country of my sample and
creates a variable with that coefficient.
- statsby _b, by(country1): reg gr_policy gr_gdp // and this captures
all the coefficients per country but then I would have to manually copy
each coefficient as many times as years I have in my database.
Would you have any piece of advice for me?
Thanks a lot,
Veronica
-----------------------------------------
This electronic message may contain confidential, proprietary or
privileged information intended solely for the use of the named
recipient. The ILO is not liable for any error or virus connected with
this transmission.
-----------------------------------------
Ce message électronique peut contenir des informations confidentielles,
ou spécialement protégées, à la seule intention du destinataire. L'OIT
ne peut être tenue responsable des erreurs ou des virus qui s'y
trouveraient.
-----------------------------------------
Este mensaje electrónico puede contener información confidencial o
especialmente protegida para el uso exclusivo del destinatario indicado.
La OIT no se responsabiliza en caso de error o virus.
-----------------------------------------
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/