Statalist


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

st: RE: keeping first digits in number


From   "Villa Lora, Juan Miguel" <[email protected]>
To   <[email protected]>
Subject   st: RE: keeping first digits in number
Date   Thu, 21 May 2009 17:03:17 -0400

JJ, you have to convert the variable to a string format using tostring
(help tostring) and then extracting the first two digits with substr...
Please see help string_functions for substr details.
Juan. 

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Juan Julio
Gutierrez
Sent: Jueves, 21 de Mayo de 2009 04:57 p.m.
To: [email protected]
Subject: st: keeping first digits in number

Hello all

I am working with ISIC codes at the four digit level, but want to
perform descriptives at the two digit level.

Ideas on how to create a variable that delete the last 2 digits of the 4
digit categories but keeps the first two?

Thank you

JJ


      
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index