Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

Re: st: display number of decimal places

From   Nick Cox <>
Subject   Re: st: display number of decimal places
Date   Tue, 11 Sep 2012 08:40:29 +0100

To insist on 6 decimal places, use a display format such as %8.6f. Use
-format- to assign that before you -list-.

I don't know what "the number of columns in a variable" is. However,
it helps to remember that to Stata the numbers you hold are all held
as binary. If the data were entered with a fixed number of decimal
places, you can (attempt to) show the same number of decimal places
with an appropriate format, as above. However, as your variable was
calculated as a z-score, 6 decimal places are a choice, and in no
sense at all are they a characteristic of the data. Seeing 6 decimal
places is just a side-effect of your display format %9.0g.

Reading should start with


On Tue, Sep 11, 2012 at 8:21 AM, Rebecca Coates <> wrote:

> Is there a way I can produce a list that shows not the number of columns in a variable, but the  maximum number of decimal places after the decimal point?
> For example, the variable RPZ_S1 is a float variable, with the format %9.0g and contains Z scores.
> Example values look like this: -1.273682
> I would like to produce a list that tells me that variable RPZ_S1 contains 6 decimal places.
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index