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]

st: problem with split command


From   Prakash Singh <prakashbhu@gmail.com>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   st: problem with split command
Date   Wed, 29 Feb 2012 08:37:21 +0530

Dear stata listers

I need help on using split command. I am working with stata 10.
I am working with survey data of Indian states, In the survey data the
variable state_name are put jointly with year in which the state is
surveyed, in this case 2005 to 2009. So the state_name variable looks
like...
Andhra2006
Arunachal2005
Assam2006
Bihar2007
UttarPradesh2009

and so on.
Now I would like to create two saperate variable out of it i.e.
state_name and year_survey.

I have used the following command
split state_name, pares(2) gen(statename)

But the problem I am facing is the statename2 variable which is
actually year variable is coming without 2 i.e. 005, 006 etc.

Please suggest me as I have read the split help and stat list postings
on split but could not work it out.

Thanks
Prakash

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