Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
umut senalp <uerksan@hotmail.com> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
RE: st: How to generate dummy for the following years |

Date |
Thu, 26 Jul 2012 18:59:20 +0300 |

Dear Ronnie, Thank you for your reply, I provided a small part of the data below, as can be seen some firms provided information for all 2003-2011 period while some of them did it for shorter period, for instance the firm which has id no: 00144277 observed only between 2007-2010. My aim is to do some kind of treatment effect analysis (effect of exporting on firm productivity in my case) by using propensity score matching approach. I already matched the data (regarding to their probability to export), now I want to analyse the export effect for the firms started to export and the effect for the following years. I copied and pasted some data since I think we cannot post attachments to Statalist. Thanks again. Best Umut firm id year export 00028073 2003 1 00028073 2004 1 00028073 2005 0 00028073 2006 1 00028073 2007 0 00028073 2008 1 00028073 2009 1 00028073 2010 1 00028073 2011 1 00036721 2003 0 00036721 2004 0 00036721 2005 0 00036721 2006 0 00036721 2007 0 00036721 2008 0 00036721 2009 0 00036721 2010 0 00047152 2003 1 00047152 2004 1 00047152 2005 1 00047152 2006 0 00047152 2007 0 00047152 2008 0 00047152 2009 0 00047152 2010 0 00047152 2011 1 00063351 2010 1 00063351 2011 1 00144277 2007 1 00144277 2008 1 00144277 2009 0 00144277 2010 1 00144614 2009 0 00144614 2010 0 00145362 2003 1 00145362 2004 1 00145362 2005 1 00147034 2003 1 00147034 2004 1 00147034 2005 1 00147034 2006 1 00147034 2007 1 00147034 2008 1 00147034 2009 1 00147034 2010 1 ---------------------------------------- > Date: Thu, 26 Jul 2012 18:16:50 +0300 > From: rb.glists@gmail.com > To: statalist@hsphsun2.harvard.edu > Subject: Re: st: How to generate dummy for the following years > > Umut > > I think this kind of question is best answered if you show some data (and may be what you are trying to achieve). You could use the very helpful -writeinput- (-ssc install writeinput-) to do this. > > Ronnie > > -- > 010100100110111101101110011011100110100101100101 > > > > > On Thursday, July 26, 2012 at 6:07 PM, umut senalp wrote: > >> Dear Stata Listers, >> >> I am using StataSE 12. I have an unbalanced data for over 2000 firms (covering the period 2003-2011) and I have a dummy variable for the firms' export status (Export=1 if firm have positive export value that year). While, a few firms observed for all 9 years (2003-2011), majority of them observed for minimum 2 years consecutively. >> I want to create a new set of dummy variables indicating the year that a firm started to export (Starter), >> one year before starting to export (Year_before),and for the following two years that the firm started to export which are Year_After and Two_Years_After. >> So, I want to generate 4 new dummies based on the firm's Export status. In addition to that, I have some firms which are exporter for the all period that they are observable (means I do not know when they started to export), and I want to name them as Always_Exporter. >> >> Since I am not so familiar with programming in Stata I tried following command but it failed, it was just for the firms that I have observation for 2003 onwards, anyway. >> gen starter=0 >> replace starter=1 if export==0 in 2003 & export==1 in 2004 >> >> And I realised that this approach will not work since I need to do it for many times for following years to catch all starters. >> >> Well, I think I need to use a program that includes loop but I don't know where to start to write the code. I would be glad if you could help me on this issue. I hope I've the issue clear enough. >> >> Kind regards >> >> Umut SENALP >> * >> * 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/ * * 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/

**References**:**st: How to generate dummy for the following years***From:*umut senalp <uerksan@hotmail.com>

**Re: st: How to generate dummy for the following years***From:*Ronnie Babigumira <rb.glists@gmail.com>

- Prev by Date:
**RE: st: Match two samples in stata** - Next by Date:
**Re: st: using stata automation with VB.net** - Previous by thread:
**Re: st: How to generate dummy for the following years** - Next by thread:
**Re: st: How to generate dummy for the following years** - Index(es):