<?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 Inquire about subgroup analysis in GEE model in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Inquire-about-subgroup-analysis-in-GEE-model/m-p/923944#M45908</link>
    <description>&lt;P&gt;&amp;nbsp;Hiii,&lt;/P&gt;&lt;P&gt;I have questions about doing subgroup analysis in the gee model,&amp;nbsp;I have a binary variable "p4p" (0,1) and I need the results of 2 groups respectively. The following code is my model&lt;/P&gt;&lt;PRE&gt;%macro testn(x);
proc genmod data=all;
class matchid adrs(ref='0') time(ref='2') age id_s dcsi ; 
model &amp;amp;x. = adrs time adrs*time ;
repeated subject = matchid/type = exch;
estimate "Diff in Diff year 1" adrs*time -1	0	0	1	0	0	1	0	0   -1	 0  0; 
estimate "Diff in Diff year 2" adrs*time -1	0	0	0	1	0	1	0	0    0  -1  0; 
estimate "Diff in Diff year 3" adrs*time -1	0	0	0	0	1	1	0	0    0   0 -1; 
lsmeans time*adrs;
run;
%mend;
%testn(return);
%testn(acsc);
%testn(score);&lt;/PRE&gt;&lt;P&gt;My previous way to solve this problem is to separate the dataset first, and then run these 2 datasets (p4p/p4p_) separately:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data p4p; set all; if p4p=1; run; &lt;BR /&gt;data p4p_; set all; if p4p=0; run;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;but I found that the estimate value will be a little bit weird if I run the model separately, so I am thinking about if I should put the subgroups in the same model.&lt;/P&gt;&lt;P&gt;I have tried to put the variable"p4p"&amp;nbsp; after the command "class", but the result is not what I have expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone knows how to do the subgroup analysis in the model???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need SAS experts please!! I really need help!!&lt;/P&gt;&lt;P&gt;THANK YOU SO MUCH!!&lt;/P&gt;</description>
    <pubDate>Thu, 11 Apr 2024 09:20:44 GMT</pubDate>
    <dc:creator>vivian_h</dc:creator>
    <dc:date>2024-04-11T09:20:44Z</dc:date>
    <item>
      <title>Inquire about subgroup analysis in GEE model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inquire-about-subgroup-analysis-in-GEE-model/m-p/923944#M45908</link>
      <description>&lt;P&gt;&amp;nbsp;Hiii,&lt;/P&gt;&lt;P&gt;I have questions about doing subgroup analysis in the gee model,&amp;nbsp;I have a binary variable "p4p" (0,1) and I need the results of 2 groups respectively. The following code is my model&lt;/P&gt;&lt;PRE&gt;%macro testn(x);
proc genmod data=all;
class matchid adrs(ref='0') time(ref='2') age id_s dcsi ; 
model &amp;amp;x. = adrs time adrs*time ;
repeated subject = matchid/type = exch;
estimate "Diff in Diff year 1" adrs*time -1	0	0	1	0	0	1	0	0   -1	 0  0; 
estimate "Diff in Diff year 2" adrs*time -1	0	0	0	1	0	1	0	0    0  -1  0; 
estimate "Diff in Diff year 3" adrs*time -1	0	0	0	0	1	1	0	0    0   0 -1; 
lsmeans time*adrs;
run;
%mend;
%testn(return);
%testn(acsc);
%testn(score);&lt;/PRE&gt;&lt;P&gt;My previous way to solve this problem is to separate the dataset first, and then run these 2 datasets (p4p/p4p_) separately:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data p4p; set all; if p4p=1; run; &lt;BR /&gt;data p4p_; set all; if p4p=0; run;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;but I found that the estimate value will be a little bit weird if I run the model separately, so I am thinking about if I should put the subgroups in the same model.&lt;/P&gt;&lt;P&gt;I have tried to put the variable"p4p"&amp;nbsp; after the command "class", but the result is not what I have expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone knows how to do the subgroup analysis in the model???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need SAS experts please!! I really need help!!&lt;/P&gt;&lt;P&gt;THANK YOU SO MUCH!!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 09:20:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inquire-about-subgroup-analysis-in-GEE-model/m-p/923944#M45908</guid>
      <dc:creator>vivian_h</dc:creator>
      <dc:date>2024-04-11T09:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Inquire about subgroup analysis in GEE model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inquire-about-subgroup-analysis-in-GEE-model/m-p/923992#M45909</link>
      <description>&lt;P&gt;You appear to want to estimate the difference in difference of the event probability among your groups. See &lt;A href="http://support.sas.com/kb/61830" target="_self"&gt;this note&lt;/A&gt; that discusses this analysis in detail. To estimate the difference in difference on the probability scale, you can use the Margins macro as shown in the "Generalized Linear Models with a Non-Identity Link" section of the note. Other macros can also be used as shown there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that any time you fit a model to a binary response model, you should specify which level of the binary response variable is considered the level of interest (the "event" level). That is shown in the Margins macro call. Also, to avoid the unnecessary omission of observations due to missing values, you should never specify CLASS variables that aren't use elsewhere in the model specification.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 16:02:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inquire-about-subgroup-analysis-in-GEE-model/m-p/923992#M45909</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2024-04-11T16:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Inquire about subgroup analysis in GEE model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inquire-about-subgroup-analysis-in-GEE-model/m-p/923994#M45910</link>
      <description>&lt;P&gt;are there any easier way&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what if i do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%macro testn(x);
proc genmod data=all;
class matchid adrs(ref='0') time(ref='2') age id_s dcsi p4p; &lt;BR /&gt;&lt;STRONG&gt;where p4p=1; /*is it feasible to do it like this*/&lt;/STRONG&gt;
model &amp;amp;x. = adrs time adrs*time ;
repeated subject = matchid/type = exch;
estimate "Diff in Diff year 1" adrs*time -1	0	0	1	0	0	1	0	0   -1	 0  0; 
estimate "Diff in Diff year 2" adrs*time -1	0	0	0	1	0	1	0	0    0  -1  0; 
estimate "Diff in Diff year 3" adrs*time -1	0	0	0	0	1	1	0	0    0   0 -1; 
lsmeans time*adrs;
run;
%mend;
%testn(return);
&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 16:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inquire-about-subgroup-analysis-in-GEE-model/m-p/923994#M45910</guid>
      <dc:creator>vivian_h</dc:creator>
      <dc:date>2024-04-11T16:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Inquire about subgroup analysis in GEE model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inquire-about-subgroup-analysis-in-GEE-model/m-p/924000#M45911</link>
      <description>If you just want a point estimate of the difference in difference of event probabilities then you can hand compute it from the results of your LSMEANS statement, but you will need to add the ILINK option in that statement. That will add the Mean column in the LSMEANS table which contains the estimated event probabilities for your combinations of TIME and ADRS. Remove the WHERE statement. The ESTIMATE statements you have, if the coefficients are correct, only tell you the difference in difference of the log odds, not of the event probabilities. You could use an LSMESTIMATE statement to do the same more simply. Examples of LSMESTIMATE are in the note.</description>
      <pubDate>Thu, 11 Apr 2024 16:43:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inquire-about-subgroup-analysis-in-GEE-model/m-p/924000#M45911</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2024-04-11T16:43:13Z</dc:date>
    </item>
  </channel>
</rss>

