Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Nick Cox <njcoxstata@gmail.com> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | Re: st: Grouping firmid or not to tsset data ? |
Date | Mon, 20 Jan 2014 21:16:19 +0000 |
If you really are typing gen firmid = group(permid) then that triggers the undocumented Stata function -group()-. That's going to be very wrong for you. With egen firmid = group(permid) you might try egen double firmid = group(permid) instead. Nick njcoxstata@gmail.com On 20 January 2014 19:03, Abdalla, Ahmed <ahmed.abdalla@kcl.ac.uk> wrote: > Dear Statalist > I have a panel id (permno) and two time variables (yr) and (mth) and want to tsset my panel based on permno yr mth > I run: > gen timeid = ym(yr, mth) > gen firmid=group(permno) > > tsset firmid timeid > //I get the error message -repeated time values within panel > > when I run tsset permno timeid > //it works properly. > > I changed my data set, and used another data set to rule out any problems with my data, however still get the same results ! > > Can I tsset when only the time variables are grouped in one timeid and the firmid is not grouped ? Is it correct? > > Thanks > > > > > > > > * > * 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/ * * 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/