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: AW: RE: AW: Identifying unique values with codebook


From   Steve Samuels <sjsamuels@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: AW: RE: AW: Identifying unique values with codebook
Date   Wed, 16 Jun 2010 11:19:52 -0400

As I implied in a crossing post, I agree with you.

Steve

On Wed, Jun 16, 2010 at 10:56 AM, Martin Weiss <martin.weiss1@gmx.de> wrote:
>
> <>
> "
> >From the help:
>  " The inspect command provides a quick summary of a numeric variable""
>
>
>
>
> If this is its purpose, why not reject non-numeric data out of hand, then?
> Instead -inspect- declares strings to be all missing. Worse still, the upper
> part of its output says
>
> "unique values:  2"
>
>
> while under its histogram, it claims
>
> "(0 unique value)"
>
>
>
>
> HTH
> Martin
>
>
> -----Ursprüngliche Nachricht-----
> Von: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Steve Samuels
> Gesendet: Mittwoch, 16. Juni 2010 16:32
> An: statalist@hsphsun2.harvard.edu
> Betreff: Re: st: AW: RE: AW: Identifying unique values with codebook
>
> >From the help:
>  " The inspect command provides a quick summary of a numeric variable"
> As -sum- reports 0 values for a string variable, so does -inspect-.
>
> Steve
>
> -
> Steven Samuels
> sjsamuels@gmail.com
> 18 Cantine's Island
> Saugerties NY 12477
> USA
> Voice: 845-246-0774
> Fax:    206-202-4783
>
>
> On Wed, Jun 16, 2010 at 10:24 AM, Martin Weiss <martin.weiss1@gmx.de> wrote:
>>
>> <>
>>
>> A "string representation" seems to work with -codebook-, but not -inspect-
>> which claims to find o unique values...
>>
>>
>> *************
>> clear*
>> inp str25 mystrvar
>> loooooooooooooooooooooooooooonnggg
>> verylooooooooooooooooooooonnnnnnnnngggg
>> end
>> ins
>> codebook
>> *************
>>
>>
>>
>> HTH
>> Martin
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: owner-statalist@hsphsun2.harvard.edu
>> [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Nick Cox
>> Gesendet: Mittwoch, 16. Juni 2010 16:13
>> An: statalist@hsphsun2.harvard.edu
>> Betreff: st: RE: AW: Identifying unique values with codebook
>>
>> As Martin says, at root this is a precision problem.
>>
>> Neither -codebook- nor anything else is to blame if it is presented with
>> the same values. To hold very large integers you may need to consider
>> -long- as another possibility, or even a string representation.
>>
>> Nick
>> n.j.cox@durham.ac.uk
>>
>> Martin Weiss
>>
>> As -help data_types- says: "doubles have 16 digits of accuracy." So you
>> can
>> increase the digits of your "y" up to the point where even -double- can
>> do
>> nothing for you:
>>
>> *************
>> clear
>> set obs 10
>> gen byte x=_n
>> codebook x
>> gen double y1 = 1000000000000000 + x
>> gen double y2 = 10000000000000000 + x
>> gen double y3 = 100000000000000000 + x
>> gen double y4 = 1000000000000000000 + x
>> codebook y?
>> ins y?
>> *************
>>
>>
>> Interestingly, -inspect- seems to differ from -codebook-`s opinion.
>>
>> Walter Garcia-Fontes
>>
>> I stumped into a problem when identifying unique values of a numeric
>> variable using "codebook": if the values are large they will be
>> identified as the same value.
>>
>> For instance I have a variable x with the following values:
>> 0, 1, 2, ... 10 (that is 10 different values)
>>
>> codebook x
>> reports "unique values: 10"
>>
>> Now do
>> gen y = 100000000000000000 + x
>>
>> codebook y
>> reports "unique values = 1"
>>
>> Is this a feature?
>>
>> *
>> *   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/
>>
>>
>> *
>> *   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/
>>
>
>
>
> -
>
> *
> *   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/
>
>
> *
> *   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/
>



-- 
Steven Samuels
sjsamuels@gmail.com
18 Cantine's Island
Saugerties NY 12477
USA
Voice: 845-246-0774
Fax:    206-202-4783

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