Statalist


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

Re: st: How to label the value 999999999999


From   "Ziad El-Khatib" <Ziad.El-Khatib@ki.se>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: How to label the value 999999999999
Date   Wed, 8 Oct 2008 11:04:53 +0100

Dear Friedrich,
I have similar situation to yours (for unknown blood results) and code
them 999999999999.
I so as Sergiy suggested or add 'if var!=999999999999' (which can be
annoying sometimes).
Best regards
ziad

On Tue, Oct 7, 2008 at 11:56 PM, Sergiy Radyakin <serjradyakin@gmail.com> wrote:
> 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 <caleb@uoregon.edu> 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index