Laura,
I think that the function - int(x) - should be what you're looking for.
Julian
Date sent: Thu, 23 Jan 2003 15:54:23 +0000 (GMT)
From: Laura Miller <[email protected]>
Subject: st: removing decimals
To: [email protected]
Send reply to: [email protected]
> My apologies for bothering you all with such a simple query.
>
> I have calculated a variable which is the age of a subject when they
> were interviewed. However this variable has several decimal places. I
> wish to change this to the whole number of years. I have tried using
>
> format varname %2.0f
>
> but as the manuals state this doesn't affect the accuracy so some of
> the ages are rounding up. I only want complete years so need to round
> them all down (or looking at it another way, I just need to 'cut off'
> the decimal points). Could anyone tell me how can I do this?
>
>
> Any suggestions appreciated.
>
> Laura
>
> **********************************************************************
> * MRC Biostatistics Unit Tel: 01223 330392 Institute of Public
> Health Fax: 01223 330388 University Forvie
> Site [email protected] Robinson
> Way http://www.mrc-bsu.cam.ac.uk Cambridge CB2 2SR
> **********************************************************************
> *
>
>
> *
> * 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/
---------------------------------------------------------
Julian A. Fennema
CERT (Centre for Economic Reform and Transformation)
Division of Economics
School of Management
Heriot-Watt University
Riccarton
Edinburgh EH14 4AS
Tel: +44 (0)131 451 3492
Fax: +44 (0)131 451 3296
*
* 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/