Error message in PROC MDC (Nested Logit Model)

Hi everyone,

I've been trying to run PROC MDC in SAS for several days and always get the
same error message, please help me!

Basically, my goal is to run a nested logit model for a dependent variable
called "pleasantness", with, for the moment, three explanatory dummy
variables (and maybe more thereafter). The dependent variable has three
alternatives: "pleasant", "unpleasant", and "neither". In order to adapt my
dataset to what PROC MDC expects, I turned each row into three rows (I copied
and pasted twice), and added a new variable called "mode" taking the values 1,
2 and 3 for each of these three new rows. Technically, this variable "mode"
corresponds to the three alternatives for my dependent variable
"pleasantness" : 1=neither, 2=pleasant, 3=unpleasant. And then I added
another extra column named "decision" which is equal to 1 if the values of
"pleasantness" and "mode" match and 0 otherwise. I hope that makes sense,
below are the first rows of my dataset:


In my mind, the dataset is now ready to be interpreted. Then, I computed the
model this way:

proc mdc data=depnested;
model decision=nuit csp emap/type=nlogit choice=(mode 1 2 3) covest=hess;
id ident;
utility u(1,)=nuit csp emap;
nest level(1)=(1 @ 1, 2 3 @ 2), level(2)=(1 2 @ 1);

The problem is that I get this message:

ERROR: The CHOICE= variable contains redundant alternatives.

...And SAS stops processing.

My first idea was that for some reason in my dataset, some cases might exist
with "decision" equal to 1 for two different values of "mode" or more, which
would be obviously senseless. But I checked with SAS and Excel, and that's
not the case! Trust me, for every case in my dataset, "decision" is equal to
1 for one and only one value of "mode".

For that reason, I don't see why I get this error message! Have you an idea
of why it's happening?

Any comment will be helpful! Thank you very much in advance,

Last edited: