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]

st: -reshape- and variable names involving zero (0)


From   Roberto Ferrer <[email protected]>
To   Stata Help <[email protected]>
Subject   st: -reshape- and variable names involving zero (0)
Date   Sun, 27 Oct 2013 20:43:17 +0000

This derived from

http://www.stata.com/statalist/archive/2013-10/msg00949.html

The following does not give the result I would expect:

*------------------------ begin code ----------------------------------------
clear
input id str4 ticker str20 type return06 return07 return08
1 "ABCB" "formation" 0.01 0.2 0.3
2 "AEDU" "formation" 0.02 0.4 0.5
3 "AMBV" "formation" 0.01 0.2 0.3
1 "ABCB" "buysell" 0.01 0.2 0.3
2 "AEDU" "buysell" 0.01 0.2 0.3
3 "AMBV" "buysell" 0.01 0.2 0.3
1 "ABCB" "holding" 0.01 0.2 0.3
2 "AEDU" "holding" 0.01 0.2 0.3
3 "AMBV" "holding" 0.01 0.2 0.3
end

reshape long return, i(id type) j(period)
list
*--------------------- end code ------------------------------------------------

In the output I can see:

xij variables:
                return6 return7 return8   ->   return

which I believe should be:

return06 return07 return08

Notice the zeros are cropped out.

If I rename return06, return07, return08 to
return16, return17, return18, the code returns what I expect.

What am I missing? What's the problem with the original names
and -reshape- ?
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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