Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: betacoef for new variable?


From   Fabian Nagel <Fabian.Nagel@uni-konstanz.de>
To   statalist@hsphsun2.harvard.edu
Subject   st: betacoef for new variable?
Date   Thu, 20 Mar 2008 22:25:41 +0100

Dear Stata-community,

I want to generate a new variable containing the current value of the beta-coefficient for each country, each year. The dataset includes 30 countries for the period from 1980-2003.

My last thought was:

forvalues i=1/30 {
reg conver lag_log_ssegdp if country==`i', noconstant
betacoef
generate beta=r(beta) if country==`i'
}

The problems I have now are:

1.
I want the beta-coefficient to be calculated for each year AND each country and not only for each country, but right now I have no idea how I can achieve this.

2.
When the loop generates beta=r(beta) I receive the r(109), type mismatch. Is there any possibility to save the beta-coefficients (for each year and each country) as a new variable?

Thanks for any suggestion in advance,
Fabian


*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* 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