I am trying to run a logistic ANOVA by the PROC GENMODE for data with binomial distribution with the SAS ver. 9.2 TS Level 2M2. The experiment has a factorial arrangement. The problem is that the code I used to write with a former version of SAS is not working any more. I got some advise from the SAS technical support but I still have problems with the syntax. Can anybody help me with this?
You need to post the code and log for any help
Only if you post your code, could us help you
The former code using proc genmod was, for instance, as follows:
model filled/nij= ecotype nitrogen ecotype*nitrogen/dist=binomial link=logit type3;
lsmeans ecotype nitrogen/diff;
ods output lsmeans=lsm;
data prob_hat;
set lsm;
phat=exp(estimate)/(1+exp(estimate));
se_phat=phat*(1-phat)*stderr;
proc print data=prob_hat;
run;
This code yielded lsm probability for treatments and standard error of the lsm probabilities.
The current code is:
model fille/nij=ecotype nitrogen ecotype*nitrogen/dist=binomial link=logit type 3;
lsm ecotype nitrogen/diff;
proc print;
run;
but this code produces the standard error not in the original unities but in the logit ones. Is there any way to obtain directly the standard error in the original unities?
Isn't that what this portion of code did in the above which is no longer in your new code?
Thought the stderr should have been converted as well I'd think...
data prob_hat;
set lsm;
phat=exp(estimate)/(1+exp(estimate));
se_phat=phat*(1-phat)*stderr;
run;
proc print data=prob_hat;
run;
But perhaps I'm not understanding what you'd like.
Also your proc print doesn't have a data= attached to it, so after running a proc I'm not sure what it would output, have you verified that its outputing what you think it should?
Yes, there is. In your lsmeans statement, add the ilink option:
lsmeans ecotype nitrogen/diff ilink:
This will give the estimates and standard errors on the inverse linked (back-transformed scale). Note well that the DIFFERENCES are not the differences between the back-transformed values, but are the back-transformed values of the differences on the logit scale--a very different thing.
Steve Denham
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.