<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic determining surgeon volume in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/determining-surgeon-volume/m-p/760474#M37071</link>
    <description>&lt;P&gt;Hi I want to get surgeon volume within previous 365 days of the operation on a person.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My objective is to test the hypothesis that if a surgeon performed greater number of operation in the last 1 year then their operation is more likely to succeed.&lt;/P&gt;&lt;P&gt;All I have is records per each service users. The recipient ID can duplicate because if&amp;nbsp; someone has a operation in first leg then they also can have operation in second leg. I am interested in first operation&lt;/P&gt;&lt;PRE&gt;data WORK.docs_have(label='Surgery Data');
    input  rcpt_id:32. service_date:date9. physician_id:32.;
   format service_date date9.;
 datalines;
 1356 22NOV2008 3354 
 1123 13OCT2010 3354 
 1267 18JAN2011 3354 
 1123 15AUG2011 3354
 1145 30NOV2009 2234 
 1323 24JAN2010 2234 
 1122 29JAN2010 2234 
 1122 13SEP2010 2234 

 ;;;;


 data WORK.docs_want(label='Surgery Data_want');
    input  rcpt_id:32. service_date:date9. physician_id:32. surg_vol:12;
   format service_date date9.;
 datalines;
 1356 22NOV2008 3354 0
 1123 13OCT2010 3354 0
 1267 18JAN2011 3354 1
 1123 15AUG2011 3354 2
 1145 30NOV2009 2234 0
 1323 24JAN2010 2234 1
 1122 29JAN2010 2234 2
 
 
 

 ;;;;&lt;/PRE&gt;&lt;P&gt;The variables are&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;recipient&amp;nbsp;ID (rcpt_id)&amp;nbsp; service date (service_date)&amp;nbsp; and&amp;nbsp;provider ID (physician_id),&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Mon, 09 Aug 2021 21:03:47 GMT</pubDate>
    <dc:creator>yubaraj</dc:creator>
    <dc:date>2021-08-09T21:03:47Z</dc:date>
    <item>
      <title>determining surgeon volume</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/determining-surgeon-volume/m-p/760474#M37071</link>
      <description>&lt;P&gt;Hi I want to get surgeon volume within previous 365 days of the operation on a person.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My objective is to test the hypothesis that if a surgeon performed greater number of operation in the last 1 year then their operation is more likely to succeed.&lt;/P&gt;&lt;P&gt;All I have is records per each service users. The recipient ID can duplicate because if&amp;nbsp; someone has a operation in first leg then they also can have operation in second leg. I am interested in first operation&lt;/P&gt;&lt;PRE&gt;data WORK.docs_have(label='Surgery Data');
    input  rcpt_id:32. service_date:date9. physician_id:32.;
   format service_date date9.;
 datalines;
 1356 22NOV2008 3354 
 1123 13OCT2010 3354 
 1267 18JAN2011 3354 
 1123 15AUG2011 3354
 1145 30NOV2009 2234 
 1323 24JAN2010 2234 
 1122 29JAN2010 2234 
 1122 13SEP2010 2234 

 ;;;;


 data WORK.docs_want(label='Surgery Data_want');
    input  rcpt_id:32. service_date:date9. physician_id:32. surg_vol:12;
   format service_date date9.;
 datalines;
 1356 22NOV2008 3354 0
 1123 13OCT2010 3354 0
 1267 18JAN2011 3354 1
 1123 15AUG2011 3354 2
 1145 30NOV2009 2234 0
 1323 24JAN2010 2234 1
 1122 29JAN2010 2234 2
 
 
 

 ;;;;&lt;/PRE&gt;&lt;P&gt;The variables are&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;recipient&amp;nbsp;ID (rcpt_id)&amp;nbsp; service date (service_date)&amp;nbsp; and&amp;nbsp;provider ID (physician_id),&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 Aug 2021 21:03:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/determining-surgeon-volume/m-p/760474#M37071</guid>
      <dc:creator>yubaraj</dc:creator>
      <dc:date>2021-08-09T21:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: determining surgeon volume</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/determining-surgeon-volume/m-p/760486#M37074</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/218503"&gt;@yubaraj&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi I want to get surgeon volume within previous 365 days of the operation on a person.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My objective is to test the hypothesis that if a surgeon performed greater number of operation in the last 1 year then their operation is more likely to succeed.&lt;/P&gt;
&lt;P&gt;All I have is records per each service users. The recipient ID can duplicate because if&amp;nbsp; someone has a operation in first leg then they also can have operation in second leg. I am interested in first operation&lt;/P&gt;
&lt;PRE&gt;data WORK.docs_have(label='Surgery Data');
    input  rcpt_id:32. service_date:date9. physician_id:32.;
   format service_date date9.;
 datalines;
 1356 22NOV2008 3354 
 1123 13OCT2010 3354 
 1267 18JAN2011 3354 
 1123 15AUG2011 3354
 1145 30NOV2009 2234 
 1323 24JAN2010 2234 
 1122 29JAN2010 2234 
 1122 13SEP2010 2234 

 ;;;;


 data WORK.docs_want(label='Surgery Data_want');
    input  rcpt_id:32. service_date:date9. physician_id:32. surg_vol:12;
   format service_date date9.;
 datalines;
 1356 22NOV2008 3354 0
 1123 13OCT2010 3354 0
 1267 18JAN2011 3354 1
 1123 15AUG2011 3354 2
 1145 30NOV2009 2234 0
 1323 24JAN2010 2234 1
 1122 29JAN2010 2234 2
 
 
 

 ;;;;&lt;/PRE&gt;
&lt;P&gt;The variables are&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;recipient&amp;nbsp;ID (rcpt_id)&amp;nbsp; service date (service_date)&amp;nbsp; and&amp;nbsp;provider ID (physician_id),&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about walking us through just how the first values of 0, 1 and 2 are derived. Step by step. Because I don't see any thing obvious about why this gets zero&lt;/P&gt;
&lt;PRE&gt; 1356 22NOV2008 3354 0&lt;/PRE&gt;
&lt;P&gt;And this gets 2&lt;/P&gt;
&lt;PRE&gt; 1123 15AUG2011 3354 2&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 22:25:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/determining-surgeon-volume/m-p/760486#M37074</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-09T22:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: determining surgeon volume</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/determining-surgeon-volume/m-p/760494#M37075</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;1356 22NOV2008 3354 0&lt;/PRE&gt;&lt;P&gt;For surgeon_id 3354 surgery on&amp;nbsp; patient 1356 (rcpt_id) was first so there is no previous surgery by that surgeon&amp;nbsp; before&amp;nbsp; 365 days of this surgery.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;1123 13OCT2010 3354 0&lt;BR /&gt;This is 0 because the previous surgery by that surgeon was not in last 365 days. &lt;/PRE&gt;&lt;PRE&gt;1123 15AUG2011 3354&lt;/PRE&gt;&lt;P&gt;Sorry, this observation should have deleted on the 'want' database. since this was second surgery on subject 1123.&lt;/P&gt;&lt;P&gt;&amp;nbsp;so basically, I am interested in first surgery for each subject, and number of first surgeries done in last 365 days by each surgeon.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 22:45:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/determining-surgeon-volume/m-p/760494#M37075</guid>
      <dc:creator>yubaraj</dc:creator>
      <dc:date>2021-08-09T22:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: determining surgeon volume</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/determining-surgeon-volume/m-p/760496#M37076</link>
      <description>&lt;P&gt;Here's one way, but the results don't match.&lt;/P&gt;
&lt;P&gt;The TEMP data set is very close but you have a person 1123 who has been listed twice which you don't want for ID 1122. &lt;STRONG&gt;What's the logic between those two differing criteria?&lt;/STRONG&gt; I'm guessing you likely have a different field you need to include in this logic as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code handles them the same.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.docs_have(label='Surgery Data');

    input  rcpt_id:32. service_date:date9. physician_id:32.;
    ID = _n_;
   format service_date date9.;
 datalines;
 1356 22NOV2008 3354 
 1123 13OCT2010 3354 
 1267 18JAN2011 3354 
 1123 15AUG2011 3354
 1145 30NOV2009 2234 
 1323 24JAN2010 2234 
 1122 29JAN2010 2234 
 1122 13SEP2010 2234 

 ;;;;
 
proc sql;
create table temp as
select *, 
   (select count(distinct t2.rcpt_Id) 
   from docs_have as t2 
   where t1.physician_id = t2.physician_id 
   and t1.ID ne t2.ID and 
   t2.service_date between t1.service_date - 365 and t1.service_date) as num_procs
from docs_have as t1
order by rcpt_id, ID
;
quit;

data want;
set temp;
by rcpt_id;
if first.rcpt_id;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/218503"&gt;@yubaraj&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi I want to get surgeon volume within previous 365 days of the operation on a person.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My objective is to test the hypothesis that if a surgeon performed greater number of operation in the last 1 year then their operation is more likely to succeed.&lt;/P&gt;
&lt;P&gt;All I have is records per each service users. The recipient ID can duplicate because if&amp;nbsp; someone has a operation in first leg then they also can have operation in second leg. I am interested in first operation&lt;/P&gt;
&lt;PRE&gt;data WORK.docs_have(label='Surgery Data');
    input  rcpt_id:32. service_date:date9. physician_id:32.;
   format service_date date9.;
 datalines;
 1356 22NOV2008 3354 
 1123 13OCT2010 3354 
 1267 18JAN2011 3354 
 1123 15AUG2011 3354
 1145 30NOV2009 2234 
 1323 24JAN2010 2234 
 1122 29JAN2010 2234 
 1122 13SEP2010 2234 

 ;;;;


 data WORK.docs_want(label='Surgery Data_want');
    input  rcpt_id:32. service_date:date9. physician_id:32. surg_vol:12;
   format service_date date9.;
 datalines;
 1356 22NOV2008 3354 0
 1123 13OCT2010 3354 0
 1267 18JAN2011 3354 1
 1123 15AUG2011 3354 2
 1145 30NOV2009 2234 0
 1323 24JAN2010 2234 1
 1122 29JAN2010 2234 2
 
 
 

 ;;;;&lt;/PRE&gt;
&lt;P&gt;The variables are&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;recipient&amp;nbsp;ID (rcpt_id)&amp;nbsp; service date (service_date)&amp;nbsp; and&amp;nbsp;provider ID (physician_id),&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE&gt; data WORK.docs_want(label='Surgery Data_want');
    input  rcpt_id:32. service_date:date9. physician_id:32. surg_vol:12;
   format service_date date9.;
 datalines;
 1356 22NOV2008 3354 0
&lt;FONT size="4" color="#FF0000"&gt;&lt;STRONG&gt; 1123 13OCT2010 3354 0&lt;/STRONG&gt;&lt;/FONT&gt;
 1267 18JAN2011 3354 1
&lt;FONT size="4" color="#FF0000"&gt;&lt;STRONG&gt; 1123 15AUG2011 3354 2&lt;/STRONG&gt;&lt;/FONT&gt;
 1145 30NOV2009 2234 0
 1323 24JAN2010 2234 1
 1122 29JAN2010 2234 2&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Aug 2021 22:55:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/determining-surgeon-volume/m-p/760496#M37076</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-09T22:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: determining surgeon volume</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/determining-surgeon-volume/m-p/760975#M37120</link>
      <description>Actually, I was interested in first surgery on a subject. So, when I selected first observation before running your code, it worked.&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Aug 2021 17:49:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/determining-surgeon-volume/m-p/760975#M37120</guid>
      <dc:creator>yubaraj</dc:creator>
      <dc:date>2021-08-11T17:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: determining surgeon volume</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/determining-surgeon-volume/m-p/760978#M37122</link>
      <description>If you do that BEFORE running the code rather than after you may miss surgery counts though. Is that what you want to do, exclude surgeries if a surgeon worked on the same patient multiple times?</description>
      <pubDate>Wed, 11 Aug 2021 17:53:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/determining-surgeon-volume/m-p/760978#M37122</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-11T17:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: determining surgeon volume</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/determining-surgeon-volume/m-p/760980#M37123</link>
      <description>Yes, I am interested in first surgeries on a patient.</description>
      <pubDate>Wed, 11 Aug 2021 17:56:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/determining-surgeon-volume/m-p/760980#M37123</guid>
      <dc:creator>yubaraj</dc:creator>
      <dc:date>2021-08-11T17:56:55Z</dc:date>
    </item>
  </channel>
</rss>

