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 on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: Unpublicized changes to Saved Results for -reshape-


From   Roger Newson <r.newson@imperial.ac.uk>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Unpublicized changes to Saved Results for -reshape-
Date   Mon, 26 Apr 2010 22:11:03 +0100

Thanks to Alan for clarifying the position re -reshape-.

One further query. The returned result -_dta[__JValLab]- still looks potentially useful to users, even though it is undocumented. And, from looking inside -reshape.ado-, it seems to me that it is used to make the -reshape wide- command reversible by using -reshape long-. Is this result likely to stay, or is it likely to disappear at any time without warning?

Best wishes

Roger


Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: r.newson@imperial.ac.uk
Web page: http://www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/popgenetics/reph/

Opinions expressed are those of the author, not of the institution.

On 26/04/2010 20:53, Alan Riley wrote:
Roger Newson (r.newson@imperial.ac.uk) asked about saved results
after -reshape-:

I have noticed some recent unpublicized changes to the Saved Results for
the -reshape- command (see -help reshape-). In my Stata 11.0 (which I
updated today to the sub-version dated 20 April 2010), the -reshape-
command produces a selection of returned dataset characteristics that is
different from the selection advertized in -help reshape-. In
particular, if I use -reshape wide-, then the advertized result
-_dta[ReS_jv]- (containing the values of the variable specified by the
-j()- option) is no longer stored. On the other hand, if the variable
specified by the -j()- option had a value label, then -reshape- saves
the unpublicized results -_dta[__JValLabName]-, containing the name of
the value label, and -_dta[__JValLab]-, containing the values of the
-j()- variable alternating with the corresponding value labels.

The changes have the appearance of being work in progress, and, when
complete, will probably extend the capabilities of -reshape- in ways
which will be useful to users like me, who frequently use -reshape- to
produce tables with multiple columns of confidence intervals (see
Section 4.4 of Newson, 2003). However, the selection of results seems
currently to be unstable, implying that it is currently not a good idea
for users to use these saved results in their own programs. Are these
results likely to stabilize soon? If not, then it is probably a good
idea for users to avoid using these results for the time being, and to
make their own solutions. (I currently often use Ben Jann's very useful
-labelsof- package, downloadable from SSC, when I want to store values
and labels of -j()- variables when using -reshape wide-.)

The saved results from -reshape- are not a work in progress and
should be stable.  We are unable to reproduce the behavior Roger
reported of the characteristic _dta[ReS_jv] not being stored after
-reshape wide-.

Roger may have noticed this because _dta[ReS_jv] is only stored if the
optional 'values' portion of the -j()- option is filled in.  If -j()- is
used with simply a variable name, with no values specified, then
_dta[ReS_jv] will not be stored.  This behavior has not changed and is
documented, if tersely, in both -help reshape- and [R] reshape.

Roger also notes that -reshape- "produces a selection of returned dataset
characteristics that is different from the selection advertized in -help
reshape-".  I believe Roger is referring to some returned results that are not
documented.  These are intentional and are needed for -reshape-'s own tracking
purposes to be able to successfully convert between wide and long forms of the
data.  These characteristics are intentionally not documented, however, as
they were not intended to be consumed by end users.


--Alan
(ariley@stata.com)

*
*   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