Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Appending unique cases based on two variables


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Appending unique cases based on two variables
Date   Thu, 9 Aug 2012 17:24:55 +0100

Is this an -append- or -merge- problem?

On Thu, Aug 9, 2012 at 4:50 PM, Logan-Greene, Patricia
<pblogang@buffalo.edu> wrote:
> Hello,
>
> I am doing a fairly complicated merge between two sets of data (from criminal court records) that each contain an ID number and dates (along with many other variables). Here's some background:
> 1. The two files represent a) an assessment, given at approximately the same time as the beginning of probation, and b) discharge records.
> 2. Each file contains ID numbers that can be used to match individuals across files. The ID number can appear multiple times in each dataset (multiple entries reflect recidivism).
> 3. The entries are dated, which represents for a) the date on which the assessment in given, and for b) the official start date for probation. Although there are multiple entries for many ID numbers, there is only one instance of a particular ID and a particular date in each file.
> 2. As the dates don't match identically, we conducted a fuzzy match that paired assessment entries with discharge information (based on the beginning of probation) when the dates were within 6 weeks of each other.
> 3. We now need to add the unique cases from the assessment data (that may represent, for example, an incomplete probation). I know how to append unique cases based on a single identifier, but not with two. Will append even work if there are duplicates for one of the identifiers?
>
> Can anyone help?
>
> Thanks!
>
>
>
> *
> *   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index