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   Tue, 11 Jan 2011 15:01:03 -0500

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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index