Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: problem with split command


From   Prakash Singh <[email protected]>
To   statalist <[email protected]>
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index