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]

From |
David Torres <torresd@umich.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: RE: Attrition question... |

Date |
Sun, 24 Oct 2010 17:10:39 -0400 |

Thanks for the tip...worked wonderfully. D -- David Diego Torres, MA(Sociology) PhD Candidate in Sociology 2044 Population Studies Center University of Michigan Institute for Social Research Ann Arbor MI 48106-1248 Tel 734.763.4098 Fax 734.763.1428 torresd at umich dot edu Quoting Nick Cox <n.j.cox@durham.ac.uk>:

A solution follows by analogy with an FAQ:FAQ . . . . . . . . . . . . . . . . . . Dropping spells ofmissing values. . . . . . . . . . . . . . . . . . . . . . . N. J. Cox andG. Longton3/07 How can I drop spells of missing values at the beginning and end of panel data? http://www.stata.com/support/faqs/data/dropmiss.html See its section 5 in particular.I assume panel identifier -id- and time variable -time- and that thevariable -interviewed- is a string variable.gsort id -time by id : drop if sum(interviewed == "y") == 0Alternatively, assume that -interviewed- is an indicator variable 1for interviewed and 0 for not. The second line becomes. by id: drop if sum(interviewed) == 0Although your posting does not explain some key features of yourdataset, you should be able to modify solutions like this afterstudy of the FAQ.On the other hand, I don't understand where the -reshape wide- ideacomes from. Datasets like this are best kept long. Also, I don'tknow what IPTW weights are.Nick n.j.cox@durham.ac.uk David Diego Torres, MA(Sociology) PhD Candidate in Sociology I have a longitudinal file on which I just completed multiple imputation. It has been reshaped to long format. I need to cycle through each case and drop all instances for which someone was missing in a round and was never interviewed again up to the most recent survey round. Is there a quick and easy way to do this? For a case like this: id interviewed? ... ... 1 y 1 n 1 y 1 y 1 y 1 n 1 n 1 n 1 n I would like to drop all information from round six on. The purpose is to drop the fully attrited cases, then reshape wide, then back to long. Then I can calculate IPTW weights. * * 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/

**References**:**st: Attrition question...***From:*David Torres <torresd@umich.edu>

**st: RE: Attrition question...***From:*Nick Cox <n.j.cox@durham.ac.uk>

- Prev by Date:
**st: Getting stock ticker symbol data into STATA** - Next by Date:
**st: Inverse probability of treatment weights** - Previous by thread:
**st: RE: Attrition question...** - Next by thread:
**st: version 10.1** - Index(es):