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: st: Obtaining descriptive Stats on matched samples Pre & Post "-Listwise Missing"


From   "Clifton Chow" <[email protected]>
To   [email protected]
Subject   st: st: Obtaining descriptive Stats on matched samples Pre & Post "-Listwise Missing"
Date   Mon, 11 Apr 2011 13:08:16 -0500

Thank you very much, Nick.

Quick follow-up.  In SPSS if one wanted to tabulate descriptives or correlations using listwise deletion, the subcommand is /Missing = listwise.  Does Stata have an equivalent syntax for specifying listwise deletion of missing values?

Very appreciative





-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Nick Cox
Sent: Monday, April 11, 2011 3:00 AM
To: [email protected]
Subject: Re: st: st: Obtaining descriptive Stats on matched samples Pre & Post

Suppose your variables include -id time q38- and you -tsset id time-.
Then the individuals who answered at both times are identified by

by id (time) : gen OK = !missing(q38) & !missing(q38[3-_n])

as for the first time _n is 1 and 3 - _n is 2 and for the second time
_n is 2 and 3 - _n is 1.

or by

bysort id : gen nmissing = sum(missing(q38))
by id : replace nmissing = nmissing[_N]
... if nmissing == 0

However, it would seem that you might want information only on
individuals who asked all questions at all times, for which you might
well start off with something more like

egen nmissing = rowmiss(q1-q50)
bysort id : replace nmissing = sum(nmissing)
by id : replace nmissing = nmissing[_N]
... if nmissing == 0

Nick

On Mon, Apr 11, 2011 at 7:02 AM, Clifton Chow
<[email protected]> wrote:

> I have an unabalanced panel dataset from an identical survey given at 2 interview periods.  There are 30-50 questions given in the survey and for each question, some individuals answered at Tiime 1 but not at Time 2 and vice-versa.  How can I obtain summary statistics on each question that was answered by individuals at both interview periods?  In other words, I need to calculate a Pre and Post mean & variance for each survey item in which there was no missing value for that item pre and post for the ssample? For example, Question 38 had N=72/95 who responded in Time 1 and N=57/95 who responded in Time 2, but some of the 57 who responded in Time 2 did not do so in Time 1.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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