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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: A more informative error mesage in -reshape-


From   Jorge Eduardo Pérez Pérez <perez.jorge@ur.edu.co>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: A more informative error mesage in -reshape-
Date   Thu, 13 Oct 2011 22:00:29 -0400

A fix that comes to my mind is to store each processed stub in a list
of processed stubs at the end of processing it, and then, before
processing the next stub, checking if it is stored in the list, and
issue a "stub already processed" error message if the stub is already
in the list. Probably this is easier said than done.

______________________
Jorge Eduardo Pérez Pérez


On Thu, Oct 13, 2011 at 6:58 PM, Nick Cox <njcoxstata@gmail.com> wrote:
> Everyone who has got an uninformative error message will sympathise,
> but in this case I think it's important to see why this one arises.
>
> First, -reshape- is here processing stubnames -- not variable names as
> Jorge loosely states.
>
> Second, -reshape- is just processing token by token. It doesn't have a
> sense of what comes next, or even that there's another stubname next
> in line, as there need not be. That's a good design, indeed more or
> less an inevitable design, for -reshape-'s multiple syntax.
>
> So, I doubt that there is a short fix to meet Jorge's suggestion.
> Naturally, this is StataCorp's decision to make.
>
> Nick
>
> 2011/10/13 Jorge Eduardo Pérez Pérez <perez.jorge@ur.edu.co>:
>> Dear Statalist
>>
>> Reshaping a lot of variables, I noticed that if by mistake, you repeat
>> one of the variables you want to reshape, Stata issues a
>> noninformative variable not found error message.
>>
>> . webuse reshape4
>> . des incf
>>
>>              storage  display     value
>> variable name   type   format      label      variable label
>> ------------------------------------------------------------------------------------------
>> incf            float  %9.0g                  f inc
>>
>> . reshape long inc inc, i(id) j(sex) string
>> (note: j = f m)
>> variable incf not found
>>
>> I think this should be changed to "inc already reshaped" or something
>> similar. When you are reshaping many variables or using varlists, the
>> mistake might be hard to notice.
>>
>
> *
> *   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   |   Site index