BookmarkSubscribeRSS Feed
JorgeLopez
Calcite | Level 5

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?

5 REPLIES 5
Reeza
Super User

You need to post the code and log for any help Smiley Happy

Jack2012
Obsidian | Level 7

Only if you post your code, could us help you

JorgeLopez
Calcite | Level 5

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?

Reeza
Super User

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?

SteveDenham
Jade | Level 19

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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 5 replies
  • 1545 views
  • 0 likes
  • 4 in conversation