<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Common Risk Difference in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911771#M45261</link>
    <description>&lt;P&gt;In the example code, what does the column=2 option work?&lt;/P&gt;&lt;P&gt;Also, it is giving me the following output.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mb_1_0-1705494904119.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92585iB1DE4282295ADF48/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mb_1_0-1705494904119.png" alt="mb_1_0-1705494904119.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Does "controlling for treatment" mean treatment is the stratifying factor?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I actually want the output in the following format where I get the common risk difference adjusted for the stratifying factor i.e., sex comparing between each treatment group and placebo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Placebo (Normal)&lt;/TD&gt;&lt;TD&gt;Treatment 1 (High)&lt;/TD&gt;&lt;TD&gt;Treatment 2 (Optimal)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; Estimated Common Risk Difference (95% CI)&lt;/TD&gt;&lt;TD&gt;-&lt;/TD&gt;&lt;TD&gt;xx (xx.x, xx.x)&lt;/TD&gt;&lt;TD&gt;xx (xx.x, xx.x)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; p-value&lt;/TD&gt;&lt;TD&gt;-&lt;/TD&gt;&lt;TD&gt;0.xxx&lt;/TD&gt;&lt;TD&gt;0.xxx&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Wed, 17 Jan 2024 12:42:48 GMT</pubDate>
    <dc:creator>mb_1</dc:creator>
    <dc:date>2024-01-17T12:42:48Z</dc:date>
    <item>
      <title>Common Risk Difference</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911565#M45244</link>
      <description>&lt;P&gt;Need to calculate common risk difference estimate for &amp;gt;=5% reduction in weight adjusting for sex between treatment groups 1,2,3,4 and the placebo group with 95% CI. The risk difference and 95% CI are based on the minimum risk weight approach by Mehrotra and Railkar. Currently I have data in the below format.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Subject&lt;/TD&gt;&lt;TD&gt;Whether &amp;gt;=5% reduction in weight&lt;/TD&gt;&lt;TD&gt;Treatment&lt;/TD&gt;&lt;TD&gt;Sex&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should I calculate the common risk difference?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 14:41:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911565#M45244</guid>
      <dc:creator>mb_1</dc:creator>
      <dc:date>2024-01-15T14:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Common Risk Difference</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911571#M45245</link>
      <description>&lt;P&gt;Use one of the methods discussed and illustrated in &lt;A href="https://support.sas.com/kb/37/228.html" target="_self"&gt;this note&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 14:57:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911571#M45245</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2024-01-15T14:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Common Risk Difference</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911578#M45246</link>
      <description>&lt;P&gt;Are any of these methods based&amp;nbsp;&lt;SPAN&gt;on the minimum risk weight approach by Mehrotra and Railkar?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 16:03:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911578#M45246</guid>
      <dc:creator>mb_1</dc:creator>
      <dc:date>2024-01-15T16:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Common Risk Difference</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911595#M45249</link>
      <description>&lt;P&gt;You gotta see this :&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Statistical-Procedures/commonriskdiff-using-MR-method-in-the-case-of-double-zero-events/m-p/876676" target="_blank"&gt;Solved: commonriskdiff using MR method in the case of double zero events - SAS Support Communities&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1705373679463.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92546i683571710EE26685/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1705373679463.png" alt="Ksharp_0-1705373679463.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 02:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911595#M45249</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-01-16T02:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Common Risk Difference</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911597#M45250</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Here is an example*/
data have;
 set sashelp.heart(obs=1000 keep=bp_status status sex rename=(bp_status=treatment));
run;

proc freq data=have;
table treatment*status*sex/commonriskdiff(column=2 cl=MR );
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1705374220068.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92547i6E6900A53F991B6E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1705374220068.png" alt="Ksharp_0-1705374220068.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 03:03:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911597#M45250</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-01-16T03:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Common Risk Difference</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911771#M45261</link>
      <description>&lt;P&gt;In the example code, what does the column=2 option work?&lt;/P&gt;&lt;P&gt;Also, it is giving me the following output.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mb_1_0-1705494904119.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92585iB1DE4282295ADF48/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mb_1_0-1705494904119.png" alt="mb_1_0-1705494904119.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Does "controlling for treatment" mean treatment is the stratifying factor?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I actually want the output in the following format where I get the common risk difference adjusted for the stratifying factor i.e., sex comparing between each treatment group and placebo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Placebo (Normal)&lt;/TD&gt;&lt;TD&gt;Treatment 1 (High)&lt;/TD&gt;&lt;TD&gt;Treatment 2 (Optimal)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; Estimated Common Risk Difference (95% CI)&lt;/TD&gt;&lt;TD&gt;-&lt;/TD&gt;&lt;TD&gt;xx (xx.x, xx.x)&lt;/TD&gt;&lt;TD&gt;xx (xx.x, xx.x)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; p-value&lt;/TD&gt;&lt;TD&gt;-&lt;/TD&gt;&lt;TD&gt;0.xxx&lt;/TD&gt;&lt;TD&gt;0.xxx&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 17 Jan 2024 12:42:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911771#M45261</guid>
      <dc:creator>mb_1</dc:creator>
      <dc:date>2024-01-17T12:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Common Risk Difference</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911904#M45262</link>
      <description>“In the example code, what does the column=2 option work?”&lt;BR /&gt;That means using the second column 's risk to build riskdiff . &lt;BR /&gt;Here is risk when sex=Male  (a.k.a   count of Male  When  Status='Alive' / count of Status='Alive')    &amp;lt;---Risk of Row1 &lt;BR /&gt;&lt;BR /&gt;or (a.k.a   count of Male When  Status='Dead' / count of Status='Dead') .   &amp;lt;-----Risk of Row2&lt;BR /&gt;&lt;BR /&gt;RiskDiff= Risk of Row1 - Risk of Row2 .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;"Does "controlling for treatment" mean treatment is the stratifying factor?"&lt;BR /&gt;Yes. That is correct.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;"i.e., sex comparing between each treatment group and placebo."&lt;BR /&gt;You need to know which variable(the strata variable)  to adjust .&lt;BR /&gt;Only include the strata/third variable, you could get COMMON Risk Diff.&lt;BR /&gt;and make sure the ROW and COLUMN variables both must have TWO levels.&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Jan 2024 05:35:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911904#M45262</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-01-18T05:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Common Risk Difference</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911978#M45272</link>
      <description>&lt;P&gt;The strata variable for the data I have is sex with 2 levels : male and female. There are 7 different treatment groups including placebo. The outcome variable has 2 levels: 0 and 1. Can you help me get the common risk estimates, min risk CI and p-value in the format I mentioned in last comment?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 15:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/911978#M45272</guid>
      <dc:creator>mb_1</dc:creator>
      <dc:date>2024-01-18T15:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Common Risk Difference</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/912047#M45278</link>
      <description>&lt;P&gt;To calculate COMMON Risk Diff , you should have a nx2x2 contingency table.&lt;/P&gt;
&lt;P&gt;So you need organize your data to form a nx2x2 table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE： updated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 set sashelp.heart(obs=1000 keep=bp_status status sex rename=(bp_status=treatment));
run;

/*
1)Firstly , Get data for Optimal and Normal ,and using "Death"  as a reference level (column=2)
2)Here the first row is Normal and second row is Optimal,so Risk Diff is Normal - Optimal 
*/
proc freq data=have(where=(treatment in ('Optimal' 'Normal')));
table sex*treatment*status/commonriskdiff(column=2 cl=MR test=MR);
ods output CommonPdiff=CommonPdiff1 CommonPdiffTests=CommonPdiffTests1;
run;

/*
1)Secondly , Get data for Optimal and High ,and using "Death" as a reference level (column=2)
2)Here the first row is High and second row is Optimal,so Risk Diff is High - Optimal 
*/
proc freq data=have(where=(treatment in ('Optimal' 'High')));
table sex*treatment*status/commonriskdiff(column=2 cl=MR test=MR);
ods output CommonPdiff=CommonPdiff2 CommonPdiffTests=CommonPdiffTests2;
run;



/*After getting datasets "CommonPdiff1" and "CommonPdiff2" , you could combine them together.*/
data want;
 merge CommonPdiff1 CommonPdiff2(rename=(value=v lowercl=l uppercl=u)) 
       CommonPdiffTests1 CommonPdiffTests2(rename=(Prob=P));
 label='Common Risk Diff(95% CI)';
 Optimal=.;
 Normal=cats(put(value,8.2),'(',put(lowercl,8.2),',',put(uppercl,8.2),')');
 High=cats(put(v,8.2),'(',put(l,8.2),',',put(u,8.2),')');
 output;
 label='Pvalue';
 Optimal=.;
 Normal=vvalue(Prob);
 High=vvalue(P);
 output;
run;

/*Print it*/
proc report data=want nowd;
column label Optimal Normal High;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1705628560490.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92676i159FAA9EA8438E0C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1705628560490.png" alt="Ksharp_0-1705628560490.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 01:43:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Common-Risk-Difference/m-p/912047#M45278</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-01-19T01:43:03Z</dc:date>
    </item>
  </channel>
</rss>

