Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Reshape from wide to long with some missing observations

From   "Sarah A. Mustillo" <>
Subject   Re: st: Reshape from wide to long with some missing observations
Date   Mon, 30 Sep 2002 21:04:24 -0400

Bryan -

I encounter this problem frequently, but know of nothing specific with
-reshape- that deals with this issue. I usually reshape the entire dataset and then drop those inconsiderate cases that are missing on the exam variable.


reshape long, i(id) j(exam)
drop if exam==.

I know this isn't the brilliant solution you were looking for, but it works!

--On Monday, September 30, 2002 4:52 PM -0400 "Sayer, Bryan" <> wrote:

I have a wide dateset of individual subjects with up to six exams.  I am
reshaping to long form, but I only want to include those exams with actual
data (it seems that some inconsiderate subjects died before the end of the
study...).  Anyway, is there an option to only include in the output
observations that have data for varlist that I am missing?  If not, what
is a good solution for dropping the observations with missing data?


Bryan Sayer
Statistician, SSS Inc.
*   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