I have a categorical independent variable (phenotype3) with 3 levels and a continuous dependent variable. I have created a dummy variable so that I can compare level 0 (my reference) to both levels 1 and 2 combined as well as individually. When I use proc GLM to compare both levels 1 and 2 to level 0, I get a significant result. But every time I do a post hoc analysis, the result comes back not significant for each of the 3 combinations which doesn’t make sense. Also when I use the original variable and not the dummy variables in order to look at the 3-way relationship, it comes back as not significant. I have included my code for the dummy coding, the model and my output in case that helps. **Dummy coding**: data Dummy;
set uniquelacfinal;
**parsing phenotype into MDD vs HC**;
if phenotype = 2 then MDDtotal = 1;
if phenotype = 1 then MDDtotal = 1;
else if phenotype in(0) then MDDtotal = 0;
**parsing into MDD only and TRD only**;
if phenotype = 2 then TRD = 1;
else if phenotype = 1 then TRD = 0;
else if phenotype = 0 then TRD = -1;
if phenotype = 1 then MDD = 1;
else if phenotype = 2 then MDD = 0;
else if phenotype = 0 then MDD = -1;
run;
**Comparing both level 2 and 3 to level 1**; proc glm data= dummy;
model loglac= mddtotal age sex;
run; RESULTS: you can see MDDtotal is significant **Trying to look at level 1 and 2 vs level 0 separately**; Proc glm data = dummy;
Model loglac = MDD TRD age sex ;
means mdd trd /hovtest;
means mdd trd / lsd waller tukey regwq;
run; RESULTS: not significant but I feel my code is wrong and I dont get an estimate for TRD And when I use the original data set and the original phenotype3 variable, it shows not significant also. ods graphics on;
proc glm data=uniquelacfinal plot=diagnostics;;
class phenotype3;
model loglac = phenotype3 age sex;
means phenotype3 / hovtest welch;
run;
ods graphics off; Is my code wrong or is there more likely a problem with my dataset? Thanks for any help!
... View more