BookmarkSubscribeRSS Feed
Smile_to_you
Calcite | Level 5

Hello, I have a result dataset from a clinical trial:

 

obj  stratum  trt  success

 1       1          A      1

 2       1         B       0

 3       2         B       1

  ......

 

I want to calculate difference of success rate between treatment A and B, as well as its CL using Miettienen-Nurminen

method stratified by the variable "stratum".

 

The code I used is

 


proc freq data=data order=formatted;
tables STRATUM*TRT*sucess/ riskdiff(cl=mn);
ods output RiskDiffCol2=pdiff;
ods output PdiffCLs=pdiffci;
run;

 

With this code I can only get MN CI within each stratum. I am wondering how I can get overall weighted CI accross stratum?

 

My SAS version is 9.4

 

Thanks!

4 REPLIES 4
Ksharp
Super User

It looks not so easy. Check:

 

http://support.sas.com/kb/37/228.html

 

data have;
input stratum  trt $  success;
cards;
1          A      1
1         B       0
1          A      0
1         B       0
1          A      1
1         B       1
1          A      1
1         B       0
1          A      0
1         B       1
1          A      0
1         B       1
1          A      1
1         B       0
1          A      0
1         B       0
2         B       1
2          A      1
2         B       1
2          A      0
2         B       0
2          A      0
2         B       1
2          A      1
2         B       1
2          A      1
2         B       0
2          A      0
2         B       0
2          A      1
2         B       0
2          A      1
2         B       0
;
run;

proc genmod data=have descend;
 class stratum trt;
 model success=stratum trt/dist=binomial link=identity;
 lsmeans trt/ diff cl ;
 effectplot /clm;
run;

 

OR

proc catmod data=have;
  response 0 1;
  model success = stratum trt / param=ref clparm;
  contrast "Prob Diff Trt A-B" trt 1  / estimate=parm;
 quit;
Smile_to_you
Calcite | Level 5

Thank you! But I am not sure if it gives us MN confidence limit.

It appears that Proc Freq can do it, but SAS does not provide detailed Syntax.

 

http://support.sas.com/documentation/cdl/en/procstat/67528/HTML/default/viewer.htm#procstat_freq_det...

 

Ksharp
Super User

As far as I know, riskdiff is only for 2x2 table, I am not sure if you can get it by including the third way/variable.

Smile_to_you
Calcite | Level 5

I am not sure how SAS can handle with statified CL with proc freq, but this is what it says on the website.

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 5590 views
  • 0 likes
  • 2 in conversation