[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

From |
David Kantor <dkantor@jhu.edu> |

To |
statalist@hsphsun2.harvard.edu |

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 n.j.cox@durham.ac.uk 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 dkantor@jhu.edu 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/

**References**:**st: RE: Specifying and implied decimal place with an infix statement***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

- Prev by Date:
**st: RE: Specifying and implied decimal place with an infix statement** - Next by Date:
**st: RE: Top ten tricks** - Previous by thread:
**st: RE: Specifying and implied decimal place with an infix statement** - Next by thread:
**st: RE: Top ten tricks** - Index(es):

© Copyright 1996–2017 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |