Statalist The Stata Listserver


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

st: reshape, dropping empty variables


From   daphna bassok <[email protected]>
To   [email protected]
Subject   st: reshape, dropping empty variables
Date   Wed, 03 May 2006 09:05:35 -0700

Hi-

I am having a bit of challenging time with the reshape command in stata, and was hoping someone had some advice.

I have 8 years of data, and it is currently in long format. I have a large number of variables in the dataset. Some of the variables have data for all eight years, but many have data only for 2002-2005 or alternatively only for 1998-2001. Therefore, when I reshape the data from long to wide, I end up with a huge number of "empty" variables, that have no values at all, and are therefore unnecessary.

I am looking for a way to drop all these empty variables, without inspecting one at a time.

Is there a quick way to do this?

Any help would be greatly appreciated.

Daphna

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