10-09-2017 03:56 PM
Thank you so, so much for your attention in advance!
I have been wrestling with these tasks so hard for many days and couldn't find the answers.
I would greatly appreciate if anyone could share your knowledge to help me out.
Please let me know if you need any clarification regarding my original question.
I have a data set (Medicare Part B Carrier line file) that has multiple lines of observation for each ID, and each ID can be treated
in multiple providers/practices identified as TINs. I need to attribute each ID to a TIN based on the total of allowed charges.
I have the following variables in the data set.
(variable name: variable description)
tax_num: TIN (Tax identification number)
f_f2f_office: Face-to-face office visit indicator (0/1)
f_onc: Oncologist indicator
f_pcp: Primary Care Physician indicator (0/1)
alowd_chrg_amt: Allowed charges for each service
A. I want to create three new variables (practice_any, practice_pcp, and practice_onc, for example).
How can I create these three variables assigning a TIN number to all the individuals?
(1) One step for a variable "practice_any" is to assign a TIN to an ID
, which has the largest total of allowed charges (by the TIN) for office visits from any physician.
(2) Another step to create a variable "practice_pcp" is to assign a TIN to an ID, which
has the largest total of allowed charges (by the TIN) for office visits with primary care physicians.
(3) Last step to create a variable "practice_onc" is to assign a TIN to an ID,
which has the largest total of allowed charges (by the TIN) for office visits with oncologists.
B. Lastly, of all the face-to-face office visits offered for each person, regardless of the TIN difference,
I want to create variables of a proportion of specialty care and primary care received by, respectively. How can I program this..?
All I can think of right now is to try proc sql to calcuate percentage.. Please enlighten me!
Thank you so much and I look forward to any help! I want to express my sincere appreciation to anyone who is willing to spend your valued time to share your knowledge. Thanks!
10-09-2017 09:56 PM
I find it close to impossible to give you an answer based on the information provided.
Please provide sample data (post a SAS data step creating such data), show us how the desired result should look like and then explain us the logic how you get from your have data to the desired result.