Statalist


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

RE: st: How to label the value 999999999999


From   "Lachenbruch, Peter" <[email protected]>
To   <[email protected]>
Subject   RE: st: How to label the value 999999999999
Date   Wed, 8 Oct 2008 08:34:13 -0700

Since you want to keep the 9999999999, one option would be to copy this
variable into another one and then encode the missing value in that one.
Do your analyses on that variable.  If your client really wants only
that variable then you have both.  You probably should document whatever
you do with a notes: comment and also in your data manual.

Tony

Peter A. Lachenbruch
Department of Public Health
Oregon State University
Corvallis, OR 97330
Phone: 541-737-3832
FAX: 541-737-4001


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Sergiy
Radyakin
Sent: Tuesday, October 07, 2008 3:57 PM
To: [email protected]
Subject: Re: st: How to label the value 999999999999

Dear Friedrich

Stata does not allow having labels defined for floating-point values.
Value 999999999999 is stored as a fp value.
Hence there is no way to have a value 999999999999 with a label in
Stata.

This is possible in SPSS, since it allows labeling any 8 bytes of data.

In Stata only integers and extended missings may have labels, but not
FP-values or strings.

I would suggest you replace 999999999999 with, say -9999 and have a
label:
label define m -9999 "[999999999999] no response"

or save the original 999999999999 value somewhere in the _notes_

Regards, Sergiy Radyakin


On Tue, Oct 7, 2008 at 6:02 PM, Caleb Southworth <[email protected]>
wrote:
> That's right. You cannot have a label that long. So:
>
> . tostring var, g(var2)
> var cannot be converted reversibly; no generate
>
> . tostring var, g(var2) force
> var2 generated as str11
> var2 was forced to string; some loss of information
>
> Perhaps -mvdecode- would be the way to go. So:
>
> mvdecode var, mv(999999999999)
>
> then, to use codebook or whatever,
>
> mvencode var, mv(999999999999)
>
> *
> *   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index