BookmarkSubscribeRSS Feed
knveraraju91
Barite | Level 11

Hi

I am calculating risk diff between treatment groups 1 and 2 by below pgm. The first record  'variable SS =1 'present only for trt=1.  I think this record is omitted by freq pgm because i am getting same values( value,stderr,lowerci,and upperci) when i ran pgm after excluding first record. I need to consider the first record also  in calculating riskdiff between trteatments. Please suggest me. Thank you

data one;
input trt res$ age ss ph $;
datalines;
1 cr 55 1 Y
1 cr 50 2 N
1 cri 55 2 Y
1 cri 50 2 N
1 cri 55 2 N
1 cr 50 2 N
1 cri 55 2 Y
1 cri 50 2 N
2 cri 55 2 Y
2 cri 50 2 N
2 cr 55 2 Y
2 cr 50 2 N
2 cri 55 2 Y
2 cr 50 2 Y
2 cri 55 2 N
2 cri 50 2 N
;

ods select none;
ods output CommonPdiff=rddds RiskDiffPlot=RiskDiffPlot;
 proc freq data = one;
                tables age*ss*ph* trt * res / riskdiff(common)  alpha = 0.05 ;
        run ;
ods select all;
1 REPLY 1
SteveDenham
Jade | Level 19

Since all records for trt 2 have ss=2, and all but one for trt 1 have ss=2, I would suggest rearranging the TABLES statement. If you truly need to look at the effect of ss, then put it next to last as in:

 

 tables age*ph* trt *ss* res / riskdiff(common)  alpha = 0.05 ;
 

Pardon the lined out part. It won't help to do anything like what I suggested there.

 

Because there are no records with ss=1 for any other cells in the crosstabulation, it always ends in a column associated with all zeroes for trt and res, and is excluded from riskdiff calculations.  You may be able to use an EXACT statement in PROC GENMOD to include this record, but without doing a lot of digging, I don't know if that will give you what you need to calculate a riskdiff.

 

SteveDenham

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 148 views
  • 0 likes
  • 2 in conversation