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
Creating a Sample from two categorical variables. Looking for replication.Hello Statalist, This is my second post, sorry in advance if I broke a rule. I have a data that co…
Very different p-values using testnl vs test after marginsI'm working with survey data on medication use among people with a disease. The question is whether …
Short Panel data + fixed effect model, questions about time dummy and unit rootHi dear Statalist, I’m exploring how the bank specific characteristics and macro variables (liquidit…
mlogit with pooled data (not mlogit for panel model)I have panel data for 40 individuals and their characteristics for 10 years. The DV is an outcome v…
How to create a date variable from month? String VariableHi I have a query my variable is in the following format: 1901m12, 1902m1 and so on. I want to separ…
Subscribe to:
Post Comments (Atom)
0 Response to Dropping dupliate dates by person
Post a Comment