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!
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;
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.
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.
I am not sure how SAS can handle with statified CL with proc freq, but this is what it says on the website.
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.
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.