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" <>
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.


2006/10/19, dferry <>:
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==.

. 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==.

. count if price0==.


*   For searches and help try:

*   For searches and help try:

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