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: reshape value label bug?


From   Sergiy Radyakin <[email protected]>
To   [email protected]
Subject   Re: st: reshape value label bug?
Date   Wed, 12 Jan 2011 13:21:32 -0500

Dear Jeph,

I can't reproduce your problem. My installation of Stata does not
contain any file with the strings that you
quoted. This means that they are either in your ado files or in your
dataset. Please check that the reshape
is the standard reshape shipped with Stata, not a custom reshape
command, that coincidentally is doing
something else (perhaps for another project).

Try one or both of the following:

1) text search in all the folders that Stata can see - I use Total
Commander, which handles this task very
well, other tools will work too.

2) set trace on, and set tracehilite = "Digoxin"
run your reshape and see when it bumps into this string. Let me know
what is the source.

If above yields nothing, create a subsample of your data. See whether
you are still getting all the 5 labels
that you quoted, or does it react to something. Try dropping some of
the variables payor_*, see what
happens. If the problem persists with a small version of the dataset
(a couple of observations) perhaps
you could post this dataset so that others could look into it?

Best Sergiy.




On Wed, Jan 12, 2011 at 10:28 AM, Jeph Herrin <[email protected]> wrote:
> I get the same problem if I -reshape clear- and if I first to remove
> ALL value labels:
>
> ==========================================================================
> . u temp
>
> . label drop _all
>
> . reshape clear
>
> . reshape long payor_ , i(pat_id)
> (note: j = 1 2 3 4 5 6 7 8 9)
>
> Data                               wide   ->   long
> -----------------------------------------------------------------------------
> Number of obs.                     1653   ->   14877
> Number of variables                  12   ->       5
> j variable (9 values)                     ->   _j
> xij variables:
>            payor_1 payor_2 ... payor_9   ->   payor_
> -----------------------------------------------------------------------------
>
> . label list
> class2:
>           1 ACE-inhibitor or ARB
>           2 Aldosterone Receptor Antagonist
>           3 Beta Blocker
>           4 Digoxin
>           5 Loop Diuretics
> ==========================================================================
>
> And look, _j also gets a variable name:
>
> ==========================================================================
>
> . d _j
>
>              storage  display     value
> variable name   type   format      label      variable label
> -----------------------------------------------------------------------
> _j              byte   %31.0g      class2     Corresponds to med group
>
> ==========================================================================
>
> ?
>
> Jeph
>
>
>
> On 1/11/2011 3:01 PM, Sergiy Radyakin wrote:
>>
>> Hi, Jeph,
>>
>> try issuing -reshape clear- before you run your reshape. I am almost
>> sure this may be the case.
>> But if it doesn't help, could you say whether "class" has any
>> occurance in your dataset before reshape?
>> E.g. there is a variable named class, (or class1, or etc), value label
>> "class" or anything similar.
>>
>> Best, Sergiy
>>
>>
>>
>> On Tue, Jan 11, 2011 at 10:47 AM, Jeph Herrin<[email protected]>  wrote:
>>>
>>> I cannot reproduce this with any system or web datasets, but it
>>> happens everytime for me; in the below I load a dataset, show that
>>> there is no value label named -class2-, apply -reshape-, and suddenly
>>> a new value label exists, and is assigned to my new variable _j. This
>>> occurs whether or not I specify the variable with option -j()-.
>>>
>>> What gives?
>>>
>>> . u analytic, clear
>>> . d, short
>>>
>>> Contains data from analytic.dta
>>>  obs:         1,653
>>>  vars:            12                          11 Jan 2011 09:29
>>>  size:        46,284 (99.9% of memory free)
>>> Sorted by:  pat_id
>>>
>>> . label list class2
>>> value label class2 not found
>>> r(111);
>>>
>>> . reshape long payor_, i(pat_id)
>>> (note: j = 1 2 3 4 5 6 7 8 9)
>>>
>>> Data                               wide   ->     long
>>>
>>> -----------------------------------------------------------------------------
>>> Number of obs.                     1653   ->     14877
>>> Number of variables                  12   ->         5
>>> j variable (9 values)                     ->     _j
>>> xij variables:
>>>            payor_1 payor_2 ... payor_9   ->     payor_
>>>
>>> -----------------------------------------------------------------------------
>>>
>>> . label list class2  //????????????
>>> class2:
>>>           1 ACE-inhibitor or ARB
>>>           2 Aldosterone Receptor Antagonist
>>>           3 Beta Blocker
>>>           4 Digoxin
>>>           5 Loop Diuretics
>>>
>>> . d
>>>
>>> Contains data
>>>  obs:        14,877
>>>  vars:             5
>>>  size:       312,417 (99.8% of memory free)   (_dta has notes)
>>>
>>> -------------------------------------------------------------------------------------------------------------------------------
>>>              storage  display     value
>>> variable name   type   format      label      variable label
>>>
>>> -------------------------------------------------------------------------------------------------------------------------------
>>> pat_id          str9   %9s                    PT ID
>>> _j              byte   %31.0g      class2     Corresponds to med group in
>>> Table 1
>>> readmit30       byte   %9.0g       noyes      Readmission within 30 days
>>> endpoint        byte   %15.0g      endpoint   Primary Endpoint
>>> payor_          byte   %9.0g
>>>
>>> -------------------------------------------------------------------------------------------------------------------------------
>>> Sorted by:  pat_id  _j
>>>     Note:  dataset has changed since last saved
>>>
>>> *
>>> *   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/
>>
>>
>> -----
>> No virus found in this message.
>> Checked by AVG - www.avg.com
>> Version: 10.0.1191 / Virus Database: 1435/3373 - Release Date: 01/11/11
>>
>>
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index