Hiii, I have questions about doing subgroup analysis in the gee model, I have a binary variable "p4p" (0,1) and I need the results of 2 groups respectively. The following code is my model %macro testn(x);
proc genmod data=all;
class matchid adrs(ref='0') time(ref='2') age id_s dcsi ;
model &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); My previous way to solve this problem is to separate the dataset first, and then run these 2 datasets (p4p/p4p_) separately: data p4p; set all; if p4p=1; run; data p4p_; set all; if p4p=0; run; 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. I have tried to put the variable"p4p" after the command "class", but the result is not what I have expected. Anyone knows how to do the subgroup analysis in the model??? Need SAS experts please!! I really need help!! THANK YOU SO MUCH!!
... View more