Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Specifying and implied decimal place with an infixstatement


From   David Kantor <[email protected]>
To   [email protected]
Subject   Re: st: RE: Specifying and implied decimal place with an infixstatement
Date   Fri, 21 May 2004 11:20:57 -0400

I would add that there is a slight danger in this method in general. In case some of the raw data have actual decimal points, you probably want their values (as they appear with the decimal points) to prevail.

-infile- with a dictionary takes care of this. In your case, a %3.1f infmt is appropriate.

FYI, when an infmt such as %3.1f is used, Stata textually inserts a decimal point if it is not present; then it reads the resulting string as a number. SAS, on the other hand, for the equivalent operation, reads the number first, and then divides by the appropriate power of 10 (this has some other consequences). But in either case, an actual decimal point in the raw data takes precedence.

-- David

At 03:41 PM 5/21/2004 +0100, you wrote:

I am not aware that you can. I'd just divide by
10 inside Stata. Any downside to that?

Nick
[email protected]

Joseph McCrary
>
> I'm reading in a text file using an infix statment. Some of
> my variables
> (the nce variables) occupy 3 columns but have an implied
> decimal between
> the 2nd and 3rd columns. How do I correctly specify this in my infix
> statement?
> [...]
David Kantor
Institute for Policy Studies
Johns Hopkins University
[email protected]
410-516-5404

*
*   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