Dear all,
a question that I find difficult to answer:
when I apply the proc glimmix on both longitudinal and non-longitudinal data and I notice that normality/homoscedasticity is violated I use the possibility of choosing the connection function "dist" but the problem I am noticing is that as long as dist = Gaussian I have no problems transcribing the estimates since they are those of the starting data.
The problem arises when I choose another distribution, for example the lognormal or gamma or other function, because now the estimates are calculated by referring to that distribution, if I reported the estimates in a table it would be complicated to explain them because they are totally different from the starting and real ones and being very different from reality how can I manage to solve this problem? Is there a counter-function or command to return to the original data?
Thank you very much
Giuseppe
Example (with this procedure the hypotheses are verified):
ods graphics on;
proc glimmix data=x.y plots=(studentpanel residualpanel);
class id time therapy;
model z =time|therapy/ solution dist=lognormal cl;
random intercept / subject=id type=un;
lsmeans time|therapy / pdiff=all adjust=tukey cl;
run;
ods graphics off;
The estimates I get are:
Control a T0 = 10.24
Tratment a T0 = 9.97
Control a T90 = 9.88
Treatment a T90 = 8.60
Same example as above (with this procedure the assumptions are violated):
ods graphics on;
proc glimmix data=x.y plots=(studentpanel residualpanel);
class id time therapy;
model z =time|therapy/ solution dist=gaussian cl;
random intercept / subject=id type=un;
lsmeans time|therapy / pdiff=all adjust=tukey cl;
run;
ods graphics off;
The estimates I get are:
Le stime che ottengo sono:
Control a T0 = 122598
Tratment a T0 = 40377
Control a T90 = 52574
Treatment a T90 = 9508.98
As you can see they are very different.
So if I reported those obtained with the lognormal how could I explain those numbers that are very far from the clinical reality?
I can't find a way to go back to the original data but with the p of the lognormal procedure.
Hi, For distributions other than the lognormal distribution, you can use the ILINK option on the LSMEANS statement to get estimates on the original scale of the data. This will not change anything in your output when used with the lognormal distribution, though, since the lognormal distribution uses an identity link.
For the lognormal distribution- you have the manually back transform your data. This other communities post has relevant suggestions on how to do that. I have not tried this myself.
Proc Glimmix data transform and backtransform - SAS Support Communities
You can also try a different distribution, instead of the lognormal distribution, then use the ILINK option.
For the case of the lognormal, if you use FMM, the predicted values that it generates are on the original scale, but in GLIMMIX they are on the log transformed (normal) scale even though both use the identity link as has been noted. This distinction is pointed out in the description of the lognormal log likelihood in the FMM documentation.
Here is an example. Again as has been pointed out, if you can use an alternative distribution like gamma or inverse gaussian with a suitable link function, that will avoid the problem by using ILINK in LSMEANS or when getting predicted values.
data L;
do x=1 to 10;
do n=1 to 1000;
y=rand('lognormal',x);
logy=log(y);
output;
end; end;
run;
proc means data=l; class x; var y logy; run;
proc fmm data=l; class x; model y=x/dist=lognormal cl;
output out=l2 pred=p; run;
proc means data=l2; class x; var p ; run;
proc glimmix data=l; class x; model y=x/dist=lognormal cl s;
lsmeans x/ilink;
output out=l3 pred(ilink)=p; run;
proc means data=l3; class x; var p ; run;
proc glimmix data=l; class x; model y=x/dist=gamma cl s;
lsmeans x/ilink;
output out=l4 pred(ilink)=p; run;
proc means data=l4; class x; var p ; run;
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.