Programming the statistical procedures from SAS

LOGISTIC ANOVA with a newer SAS release

Reply
New Contributor
Posts: 2

LOGISTIC ANOVA with a newer SAS release

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?

Grand Advisor
Posts: 16,908

LOGISTIC ANOVA with a newer SAS release

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

Frequent Contributor
Posts: 86

LOGISTIC ANOVA with a newer SAS release

Only if you post your code, could us help you

New Contributor
Posts: 2

LOGISTIC ANOVA with a newer SAS release

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?

Grand Advisor
Posts: 16,908

LOGISTIC ANOVA with a newer SAS release

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?

Respected Advisor
Posts: 2,655

LOGISTIC ANOVA with a newer SAS release

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

Ask a Question
Discussion stats
  • 5 replies
  • 209 views
  • 0 likes
  • 4 in conversation