Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Joseph Coveney" <stajc2@gmail.com> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | Re: st: Re: how to search every observation of one variable in another variable |
Date | Thu, 13 Jun 2013 21:16:46 +0900 |
ibrahim bostan wrote: the code you gave did not work because citing patent no is not unique identifier, can it be fixed? it gave this error; "variable citing_pt_no does not uniquely identify observations in the using data" -------------------------------------------------------------------------------- I assume that you're referring to the result of the -isid- command. Put the following just before it: contract citing_pt_no patent_owner and then proceed with -isid-. As Sergiy Radyakin shows later in the thread, you don't need to decompose the dataset into the two components and then reconstruct it. You can just -merge-the one back into the original dataset. Unless you're confident that there aren't any errors in the dataset (such as a citing patent's having one owner early in the dataset and by accident having another owner later on in the dataset), I recommend applying the constraints and checks (-contract-, -isid-, -merge 1:... assert()-, etc.) that I showed. Also, unless your dataset has a dummy entry of each cited patent's citing itself in order to assure that every cited patent has an owner, you might want to consider setting the indicator variable to .u (for "Unknown") for observations where the cited-patent owners are "Other" (my code; probably would have been better as "Unknown" and not "Other") or blank (Sergiy's code). That way you can keep track of citing patents where your dataset doesn't really allow you to say whether the owner owns the cited patent. Joseph Coveney * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/