BookmarkSubscribeRSS Feed
mikemangini
Obsidian | Level 7

SAS Community, I found this code in an archive at work and it contains no comments. The idea is to calculate a reliable sample size. It is not working properly and I am seeking to understand each component. 

 

The input table cy11rates contains the unique provider ID, risk adjusted rate of complication (rsrr_hwr) and total patient volumn. Is anyone familiar with this process that could help me understand?

 

data temp;
set cy11rates;
numerator=round(rsrr_hwr*volume);
do i=1 to volume;
d=1;
if i<= numerator then n=1;
else n=0;
output;
end;
run;

proc sql;
select sum(volume) into:cnt
from cy11rates;
quit;

proc freq data=temp;
tables provid /out=b;
run;

data c;
set b;
rtsq=count*count;
rtdv=rtsq/&cnt.;
run;

proc summary sum data=c;
var rtdv;
output out=new sum=nv;
run;

data new2;
set new;
t=(&cnt.-nv)/(_freq_-1);
run;

proc print data=new2; run;

proc anova data=temp;
ods output OverallANOVA =anova_result;
class provid;
model n=provid;
run;
quit;

proc sql;
create table reliability as
select distinct (Fvalue-1)/(Fvalue-1+t) as ICC,
t*(calculated ICC)/(1+(t-1)*(calculated ICC)) as reliability,
(0.7-0.7*(calculated ICC))/((calculated ICC)-(0.7*(calculated ICC))) as sample_size
from new2
join anova_result
on 1=1
where anova_result.source='Model';
quit;

3 REPLIES 3
ballardw
Super User

Please describe how "it is not working properly". Error messages? Post the errors and log.

No output? Unexpected output? How is it  unexpected.

 

Also dealing with sample size generation I would recommend looking into proc power.

 

 

mikemangini
Obsidian | Level 7

Thank you for your reply. I received a sample size that was a negative number. My hope was to better understand the workings of the procedure so I could determine if adjustments are needed or if the code is bad. The hope was to get a general idea of each step. I will look into proc power though and appreciate that suggestion.

mikemangini
Obsidian | Level 7

My understanding of proc power is to plan sample size for a comparison of means. In my analysis I do not have an intervention. I wish to know the minimum patient volume for a provider group so that a risk adjusted complication rate can be considered stable.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1386 views
  • 0 likes
  • 2 in conversation