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" <JUANMIGUELV@Contractual.iadb.org>
To   <statalist@hsphsun2.harvard.edu>
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: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Juan Julio
Gutierrez
Sent: Jueves, 21 de Mayo de 2009 04:57 p.m.
To: statalist@hsphsun2.harvard.edu
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index