Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Data loss with -reshape-


From   "Radu Ban" <[email protected]>
To   [email protected]
Subject   Re: st: Data loss with -reshape-
Date   Thu, 19 Oct 2006 21:16:32 +0100

Hi Danielle,

I think this is only natural. Since a make can be either domestic or
domestic at a time, then price1 (foreign price)  will be missing for
domestic cars and price0 (domestic price) will be missing for foreign
cars. Also note that the number of observations doesn't change when
you do the reshape, so nothing is lost.

Best,
Radu

2006/10/19, dferry <[email protected]>:
Dear Statalisters,
I seem to be losing data with -reshape-. This has never happened to me before. Am I just being a total idiot? (I am running the most recent version of Stata 9 SE on a Win XP box, and yes, I rebooted).

. sysuse auto, clear
(1978 Automobile Data)

. count if price==.
    0

. reshape wide price, i(make) j(foreign)
(note: j = 0 1)

Data                               long   ->   wide
-----------------------------------------------------------------------------
Number of obs.                       74   ->      74
Number of variables                  12   ->      12
j variable (2 values)           foreign   ->   (dropped)
xij variables:
                                  price   ->   price0 price1
-----------------------------------------------------------------------------

. count if price1==.
   52

. count if price0==.
   22

Sincerely,
Danielle


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index