Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: reshape issue


From   "Ada Ma" <heu034@googlemail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: reshape issue
Date   Wed, 20 Apr 2011 20:25:08 +0000

what other variables you have in your data?

There is no point to reshape something with only year and I'd

And you don't need to convert yr into string as Stata will take care of that.



Sent using BlackBerry®

-----Original Message-----
From: R G <rghertner@yahoo.com>
Sender: owner-statalist@hsphsun2.harvard.edu
Date: Wed, 20 Apr 2011 12:46:58 
To: <statalist@hsphsun2.harvard.edu>
Reply-To: statalist@hsphsun2.harvard.eduSubject: st: reshape issue

Hi Statalisters:

I'm having some problems with reshape, probably something really simple.

I have a long dataset with two variables: caseid yr. I want to reshape to wide, 
so it would be: caseid y1999 y2000 y2001 etc.
caseid is a string variable, so I've converted yr to a string as well.
I do:

reshape wide yr, i(caseid) j(yr) string

and I get:
(note: j = 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010)
variable yr not found

Any advice?

Robin

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