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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register 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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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