Hello, I am working with claims data and trying to drop duplicate dates by person in order to identify a single date for a group of claims
I have tried to generate an tag id by date and drop based on 0s but, so far, I am unable to get this to work. Would sure appreciate help with this. Thanks. Jake
I have also tried the following:
sort unique_person_id pert_service_start_dt
capture drop dup
quietly by pert_service_start_dt (unique_person_id): gen dup = cond(_N==1,0,_n)
clear
input long unique_person_id str10 pert_service_start_dt
1 "2013-07-12"
1 "2014-04-28"
1 "2014-10-17"
1 "2014-12-05"
1 "2014-12-22"
1 "2015-02-23"
1 "2015-03-05"
1 "2015-03-10"
1 "2015-04-28"
1 "2015-05-16"
1 "2015-07-19"
1 "2015-09-27"
1 "2015-09-28"
1 "2015-09-28"
1 "2015-12-01"
2 "2013-07-20"
2 "2013-10-14"
2 "2013-10-14"
2 "2013-10-14"
2 "2013-10-14"
2 "2013-10-14"
2 "2013-11-03"
2 "2013-11-03"
2 "2013-11-22"
2 "2013-11-24"
2 "2013-11-24"
2 "2013-11-24"
2 "2013-11-24"
2 "2013-11-24"
2 "2013-12-11"
2 "2013-12-11"
2 "2013-12-14"
2 "2013-12-14"
2 "2013-12-18"
2 "2013-12-28"
2 "2014-02-07"
2 "2014-03-03"
2 "2014-03-20"
2 "2014-03-31"
2 "2014-03-31"
2 "2014-03-31"
2 "2014-03-31"
2 "2014-04-06"
2 "2014-04-17"
2 "2014-04-17"
2 "2014-04-20"
2 "2014-04-20"
2 "2014-04-20"
2 "2014-04-20"
2 "2014-04-20"
2 "2014-04-30"
2 "2014-04-30"
2 "2014-04-30"
2 "2014-04-30"
2 "2014-04-30"
2 "2014-05-01"
2 "2014-05-01"
2 "2014-05-01"
2 "2014-05-01"
2 "2014-05-01"
2 "2014-05-02"
2 "2014-05-02"
2 "2014-05-02"
2 "2014-07-03"
2 "2014-07-03"
2 "2014-07-03"
2 "2014-07-19"
2 "2014-07-29"
2 "2014-07-30"
2 "2014-07-30"
2 "2014-08-17"
2 "2014-09-14"
2 "2014-09-22"
2 "2014-09-22"
2 "2014-09-22"
2 "2014-09-27"
2 "2014-10-02"
2 "2014-10-02"
2 "2014-10-07"
2 "2014-10-21"
2 "2014-10-21"
2 "2014-10-21"
2 "2014-10-21"
2 "2014-10-24"
2 "2014-10-24"
2 "2014-10-24"
2 "2014-10-24"
2 "2014-10-29"
2 "2014-10-29"
2 "2014-10-29"
2 "2014-10-29"
2 "2014-10-30"
2 "2014-12-05"
2 "2014-12-05"
2 "2014-12-12"
2 "2014-12-12"
2 "2014-12-12"
2 "2014-12-31"
2 "2015-01-26"
2 "2015-01-26"
end
[/CODE]
Related Posts with Dropping dupliate dates by person
covert date with two digital yearHi Friend, I need to convert the string date format, such as "22-Apr-18" to date format. It seems th…
Autocorrelation Diff in DiffHello, I am working on the following Diff in diff model: ln_sales = b0 + b1*treatment + b2*(treat…
Estimating the gravity model using PPLM, general adviceHi, For my thesis I am intending to estimate a gravity model, looking at specifically the effect of…
Foreach and forevalues loopHi, I have a list of variables that look as follows: max_1 max_2 max_3. All the numbers in the vari…
Relative survival and relative excess risk (RER) using imputed dataHi everyone, Does anyone know how I can calculate relative survival (strs) and relative excess risk…
Subscribe to:
Post Comments (Atom)
0 Response to Dropping dupliate dates by person
Post a Comment