# How to calculate adjusted proportion for each group?

**URL:** <https://discourse.datamethods.org/t/how-to-calculate-adjusted-proportion-for-each-group/6837>\
**Category:** data analysis\
**Tags:** regression, logistic-regression\
**Created:** [June 2, 2023, 1:07am UTC](https://discourse.datamethods.org/t/how-to-calculate-adjusted-proportion-for-each-group/6837 "2023-06-02T01:07:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bridge\_Yellow](https://discourse.datamethods.org/user_avatar/discourse.datamethods.org/bridge_yellow/32/2711_2.png) [@Bridge\_Yellow](https://discourse.datamethods.org/u/Bridge_Yellow)\
**Post date:** [June 2, 2023, 1:07am UTC](https://discourse.datamethods.org/t/how-to-calculate-adjusted-proportion-for-each-group/6837/1 "2023-06-02T01:07:18Z")

</div>

Adjusted mean for each group can be calculated using least squared method. How to calculate adjusted proportion for each group?  
A SAS example data here,  
data a;  
input a b f g;  
cards;  
1 1 60 1  
1 2 390 1  
2 1 200 1  
2 2 450 1  
1 1 6 2  
1 2 44 2  
2 1 20 2  
2 2 20 2  
;  
run;

proc freq data=a;  
tables g_a_b/riskdiff (common column=both CL=(WALD WILSON)) chisq fisher cmh cl alpha=0.05;;  
weight f;  
run;

---

<div class="post-metadata">

**Author:** ![f2harrell](https://discourse.datamethods.org/user_avatar/discourse.datamethods.org/f2harrell/32/165_2.png) [@f2harrell](https://discourse.datamethods.org/u/f2harrell)\
**Post date:** [June 2, 2023, 1:18pm UTC](https://discourse.datamethods.org/t/how-to-calculate-adjusted-proportion-for-each-group/6837/2 "2023-06-02T13:18:30Z")

</div>

It would help if you stated your ultimate analysis goals. And Cochran-Mantel-Haenszel methods are considered to be obsolete by most statisticians, yielding to logistic regression where it is easy to get adjusted probability estimates and to interpret them.
