Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[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 <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Re: svmat is changing numbers - a rounding problem?
Date   Thu, 23 May 2013 10:11:11 +0100

I am not surprised that you think that and I am sympathetic.

Minimally, there is a fix to your problem and it is documented. The
more documentation you read, the more you will understand, but you are
a busy person too. Everyone has their own trade-off here.

Historically, giving users control over variable types was a feature
and reflected the fact that many users struggled with memory
limitations. It can't be said that struggle has gone away.

That doesn't rule out -svmat- being smarter on your behalf. In fact
that is programmable by users but these days, Mata is where the action
is. Again, that doesn't stop -svmat- being useful.

-svmat- is an old command that hasn't been rethought for a long time.
Implicitly I suggested small changes in 2000 that have not yet been
implemented:

dm79 from http://www.stata.com/stb/stb56
    STB-56 dm79.  Yet more matrix commands / STB insert by Nicholas J. Cox,
    University of Durham, UK / Support:  [email protected] / After
    intallation see help matcorr, help matselrc, help matvech, / help matvtom,
    help svmatsv, help matewmf, help matvec, / help matvsort, and help svmat2

http://stata.com/products/stb/journals/stb56.pdf

This is a matter for StataCorp.  They have trade-offs too, notably
between enhancing old commands that aren't really broken and adding
exciting new stuff.

Nick
[email protected]


On 23 May 2013 08:35, Kasal Roman <[email protected]> wrote:
> double has just helped, thank you
>
> but anyway it's strange you must have these knowledge to calculate so
> simple tasks
>
> roman
>
> On Thu, May 23, 2013 at 9:24 AM, Nick Cox <[email protected]> wrote:
>> 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
>> [email protected]
>>
>> On 23 May 2013 08:12, Kasal Roman <[email protected]> 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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index