Programming the statistical procedures from SAS

ERROR: Model hierarchy is violated with INCLUDE=1 in PROC LOGISTIC

Reply
Frequent Contributor
Posts: 102

ERROR: Model hierarchy is violated with INCLUDE=1 in PROC LOGISTIC

Can't find anything in SAS Documentation about this error.  What does it even mean?

Here's the PROC LOGISTIC that gives the error:

proc logistic data=AnalyzeData desc;

  class Covar11 Covar12;

  model Outcome= Covar1*Covar2 ... Covar40

  / Selection=stepwise Include=1 SLStay=.2 SLEntry=.2

           LackFit NoDummyPrint RSquare;

run;

Note that the first argument is an interaction term.  Removing the interaction from the covariate list or switching the selection method to BACKWARD eliminates the problem.

Trusted Advisor
Posts: 1,195

Re: ERROR: Model hierarchy is violated with INCLUDE=1 in PROC LOGISTIC

Hi,

The INCLUDE option directs PROC LOGISTIC to keep the first variable listed in the MODEL Statement in every model it creates during execution of this task. Covar1 appears as a covariate with Covar2. Try putting like Covar1 Covar1*Covar2....may solve the problem.

Frequent Contributor
Posts: 102

Re: ERROR: Model hierarchy is violated with INCLUDE=1 in PROC LOGISTIC

I want to force the interaction, not Covar1.  BTW, replacing the string 'Covar1*Covar2' with 'Covar1|Covar2' also eliminates the error.  Even though the INCLUDE=1 statements specifies only 1 variable, all three components of the Covar1|Covar2 get forced into the model.  This happens to be what I want in this particular case, but what if I only wanted to force the multiplicative term? 


I still don't understand what Hierarchy is violated.  Do the simple effects of the interaction term have to be in the model for it to run?  I can see how that makes sense statistically but not from the strict programming point of view.

Respected Advisor
Posts: 2,655

Re: ERROR: Model hierarchy is violated with INCLUDE=1 in PROC LOGISTIC

In fact, the simple effects of the interaction term MUST be in the model, using the algorithms that SAS implements for model selection. See the HIERARCHY option for details, where HIERARCHY=SINGLE is given as the default. HIERARCHY=NONE ought to set things so that it would include the interaction but not the simple effects.

Steve Denham

Frequent Contributor
Posts: 102

Re: ERROR: Model hierarchy is violated with INCLUDE=1 in PROC LOGISTIC

Thanks!  It would be helpful if SAS included the reference to the HIERARCHY option in the error message.

Respected Advisor
Posts: 2,655

Re: ERROR: Model hierarchy is violated with INCLUDE=1 in PROC LOGISTIC

Well, if they did that consistently across procedures, I guess half of the traffic in this forum would disappear :smileymischief:

Steve Denham

Frequent Contributor
Posts: 102

Re: ERROR: Model hierarchy is violated with INCLUDE=1 in PROC LOGISTIC

You're right, Steve.  What would we do then?  Actual work!?!?!:smileyshocked:

Respected Advisor
Posts: 2,655

Re: ERROR: Model hierarchy is violated with INCLUDE=1 in PROC LOGISTIC

This is what I do while PROC GLIMMIX is running

And running

And running

Steve Denham

Frequent Contributor
Posts: 102

Re: ERROR: Model hierarchy is violated with INCLUDE=1 in PROC LOGISTIC

I recommend that you switch to PROC NLMIXED.  You'll have a lot more time for this Smiley Happy

Respected Advisor
Posts: 2,655

Re: ERROR: Model hierarchy is violated with INCLUDE=1 in PROC LOGISTIC

I have tried.  I usually spend a lot more time writing code with NLMIXED, so I can't just set something up and let it cook for a couple of hours.

I was afraid you were going to point me at MCMC... (or even scarier point MCMC at me.

Oh yeah, one other thing.  Stopping Stepwise by Flom and Cassell.

Steve Denham

Ask a Question
Discussion stats
  • 9 replies
  • 332 views
  • 4 likes
  • 3 in conversation