Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: destringing a variable?


From   "Ms. Marilyn Ibarra" <[email protected]>
To   [email protected]
Subject   st: destringing a variable?
Date   Wed, 12 Sep 2007 11:35:05 -0400 (EDT)

I need to destring a variable 'foreign_id' so I can declare a dataset to be panel as follows:

xtset foreign_id year, yearly

However, my variable 'foreign_id' is constructed as follows:

firm      foreign_id
1           5011x
1           5011x
1           5011x
2           0017 
2           0017 
2           0017 
etc.

I guess the solution is to get rid of the 'x' part.  Anyone know how I can easily do this so I am left with: 


firm      foreign_id
1           5011
1           5011
1           5011
2           0017
2           0017 
2           0017 


Thanks,
Marilyn. 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index