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, statalist.org is already up and running.


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

Re: st: Losing precision when saving to postfile


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Losing precision when saving to postfile
Date   Tue, 9 Aug 2011 21:19:33 +0100

What is missing here from your post is the datatype of -pvalue-. If
you are putting results into a -float-, which is the default datatype,
then you will lose precision. You should use a -double-, although my
visceral instinct is that won't help the underlying science here.

On Tue, Aug 9, 2011 at 8:04 PM, Shubhabrata Mukherjee
<joy_stat@yahoo.com> wrote:

>  I was trying to save results from an ordinal logistic regression to a postfile and was wondering why it's losing precision after some decimal places.
>
> When I type ereturn after performing the rgression, I get
>
> e(p) =  .0208020545704587.
>
> Afterwards opening the postfile and typing
>
>
> display " " %12.10f pvalue gives me the following:
>
> 0.0208020546 which is fine, but when typing
>
>
> display " " %20.15f pvalue, I get 0.020802054554224
>
>
> What am I doing wrong here?
>

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