Bookmark and Share

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: AW: Regressions with constant independent variable


From   "Dithmer, Jan" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: AW: Regressions with constant independent variable
Date   Wed, 11 Apr 2012 10:48:56 +0200

If you want to create a new variable, s.th like the following may work (if I understand you correctly):

by cusip: gen salesinitial = sales if fyear=="first observation of fyear"
by cusip: replace salesinitial = salesinitial[_n-1] if salesinitial==.

It may be possible to do it in one step, but unfortunately I don't know how and would also be interested in a shorter solution.

Best, Jan

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] Im Auftrag von Fabian Schönenberger
Gesendet: Wednesday, April 11, 2012 8:55 AM
An: [email protected]
Betreff: st: Regressions with constant independent variable

Dear Statalist
I would like to run a regression like Y=a + b*x + c*z + e for panel data. ID is cusip, and t is fyear, x is sales and z is growth of sales. 
I would like to keep x fixed for each cusip at the level of the first observation of fyear. 
Do I need to create a new variable or can I adjust my regression formula?
Many thanks in advance.

FS

*
*   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/

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index