Bookmark and Share

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

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

st: problem with split command

From   Prakash Singh <>
To   statalist <>
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

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.


*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index