Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Dithmer, Jan" <jdithme@food-econ.uni-kiel.de> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
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: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Fabian Schönenberger Gesendet: Wednesday, April 11, 2012 8:55 AM An: statalist@hsphsun2.harvard.edu 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/