BookmarkSubscribeRSS Feed
HappySASUE
Quartz | Level 8

 

Is there a SAS procedure to calculate p-value for Mantel-Haenszel Stratum Weighted Method for risk difference in stratified samples? It provided the CI but I can't find p-value for this test. 

HappySASUE_0-1651080129961.png

 

SAS code I used is

ods output CommonPdiff=CommonPdiff   ;

proc freq data  = resp order=data;

       tables stratum1*stratum2*trt01pn*resp/riskdiff(common)  ;

run;

 

I can't find option from

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_freq_details.htm

 

Many thanks

10 REPLIES 10
StatDave
SAS Super FREQ

You can do this by taking a model-based approach. Fit a logistic model that includes your treatment variable and your stratifying variables and include an LSMEANS statement with the DIFF option to compare the treatments. For example, assuming that your binary response variable is Y with values 0 and 1, where 1 represents the event of interest:

 

  proc logistic;
         class trt strat1 strat2 / param=glm;
         model y(event="1") = trt strat1 strat2;
         lsmeans trt / ilink diff cl;
         run;

You might also want to look at the discussion in this note which is more important when you want to estimate as well as test the risk difference. That note shows how it can be estimated as either the marginal effect of treatment or as a difference of LS-means.

Ksharp
Super User
Try add CMH option in TABLE.
HappySASUE
Quartz | Level 8

Thanks. 

 

There are 3 p-values, which one I should use? 

 

 

HappySASUE_0-1651237176848.png

 

Ksharp
Super User
This three P value correspond to three Hypothesis .
It look like trt01pn and resp have correlation/association after adjusting MUTCAT and HGBCAT .
But these three Hypothesis has nothing to do with RISK . the second statistic is saying the two treat(trt01pn) has different response(resp) . But is more like ANOVA not like RISK .

Or could you also try RELRISK option ?
HappySASUE
Quartz | Level 8

 

Hi Ksharp, 

Thank you for your patience and help. I added the option, but still no p-value. It is very strange no p-value but CI for MH test. 

HappySASUE_0-1651248512218.png

 

ods output CommonPdiff=CommonPdiff CMH=cmhpval ;
proc freq data = resp order=data;
tables mutcat*hgbcat*trt01pn*resp/riskdiff(common) cmh RELRISK ;
run;

 

StatDave
SAS Super FREQ
If you don't want to take the model-based approach I mentioned earlier, then you can use the COMMONRISKDIFF(TEST) option in PROC FREQ. If you want to test the risk difference, then you don't want the RELRISK option which gives the ratio of risks, not the difference.
HappySASUE
Quartz | Level 8

Thanks. 

 

Does proc logistic also create the risk difference p value? 

 

Best, 

StatDave
SAS Super FREQ
Yes, the DIFF option in the LSMEANS statement gives a p-value for the difference. The downside with the model-based approach is that you might encounter problems fitting the model particularly if the data are made sparse by the model specification.
Ksharp
Super User
Or you could check CI ?
For RISKDIFF ,check if CI contains 0 .
For RELRISK ,check if CI contains 1 .
HappySASUE
Quartz | Level 8

I had already used logistic regression, need this more sensitivity analysis. 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 10 replies
  • 3286 views
  • 1 like
  • 3 in conversation