Statalist


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

st: Re: keeping first digits in number


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: Re: keeping first digits in number
Date   Thu, 21 May 2009 23:06:02 +0200

<>

***
clear*

input isiccode
4354
6512
1965
9843
1234
end

compress
list, noobs

gen twodigit=int(isiccode/100)
l
***

HTH
Martin
_______________________
----- Original Message ----- From: "Juan Julio Gutierrez" <[email protected]>
To: <[email protected]>
Sent: Thursday, May 21, 2009 10:56 PM
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