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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Re: svmat is changing numbers - a rounding problem?


From   Nick Cox <njcoxstata@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Re: svmat is changing numbers - a rounding problem?
Date   Thu, 23 May 2013 08:24:58 +0100

You used the default of -svmat- but the full syntax is documented

 svmat [type] A [, names(col|eqcol|matcol|string)]

The key detail is [type]. Click on it in the help and you will get
further information.

You need to specify a -double- or -long- type, whichever is more
appropriate for your data.

Stata puts responsibility on the user when using -generate-  (which is
implicit here) to use the appropriate data type. Your data are too
large for -float-s to hold every digit accurately.

Nick
njcoxstata@gmail.com

On 23 May 2013 08:12, Kasal Roman <kasalroman@gmail.com> wrote:
> Please, could you explain me why the svmat command changes numbers?
>
> just a simple example:
>
> "
> . mat A=19903011
>
> . clear
>
> . svmat A
> number of observations will be reset to 1
> Press any key to continue, or Break to abort
> obs was 0, now 1
>
> . di A1
> 19903012
> "
> Its a huge problem to me.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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