Statalist


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

st: Help with data cleaning


From   Marcello Pagano <pagano@hsph.harvard.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Help with data cleaning
Date   Sun, 15 Jun 2008 10:06:14 -0400

For Melonie:

> From: Melonie Sullivan <meloniebeth@yahoo.com>
> Subject: help with data cleaning
> To: "stata listserve" <statalist@hsphsun2.harvard.edu>
> Date: Saturday, June 14, 2008, 5:26 PM
> Pcode	Admit	   Release
> 32	7/9/2003	   4/5/2004
> 32	7/9/2003	   8/19/2004
> 10	8/1/2004	   8/11/204
> 25	8/27/2004	   11/4/2004
> 25	11/4/2004	   2/24/2006
> 
> 
>  
> 
> Above is an example of juvenile placement history data;
> placement type code, admission and release dates. In
> attempting to generate a variable reflecting duration of
> placement, I am running into several problems.
> Unfortunately, I have over 16,000 records of this type, so
> hand cleaning these particular problems seems rather
> overwhelming. Can you suggest coding that will clean this
> data of the following problems?
> 
> 
> (1) A double entry as in placement type 32; two entries
> with overlapping dates, i.e., this is a single placement
> lasting from 7/09/2003 to 8/19/2003. (A planned release on
> 4/5/2004 did not happen.) How to collapse these kind of
> entries into a single entry with the correct release date?
>  
> 
> (2) Youth are often in detention (Type 10) placements while
> in other types of secure confinements (type 32), so that
> days in lock-up are double counted when attempting to
> calculate days in lockup during a given time frame. I need
> to eliminate this double counting. 
>  
> 
> (3) In attempting to simultaneously identify a given
> placement event and the service dates, I have some
> contiguous or run-on entries that need to be collapsed into
> one, as in placement type 25 above, I need to identify one
> placement with service dates of 8/27/04 to 2/24/06.
>  
> 
> Many thanks for any suggestions,
> 
> 
> Melonie Sullivan
> 
> Executive Director, FamiliFirst


      


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index