BookmarkSubscribeRSS Feed
Linh1
Calcite | Level 5

I'm preparing my data to run proc MDC but kept receiving the error: "ERROR: The NCHOICE= option is not allowed when the number of choices for each individual (ID) is not the same." I don't really get what it means. Could you help me figure out what's wrong?

 

The original dataset (final1) is a panel transaction data that has the columns: customerid, week, brand, p1 p2 p3 p4 d1 d2 d3 d4 f1 f2 f3 f4.

(P1-P4 are average price of brand 1-4 in that week, respectively. D1-4 are dummy variables showing whether that brand  is displayed in store, f1-4 are dummy variables that show whether brand 1-4 are featured in the store ads)

 

I used this code to prepare the data and the outcome is in the attached file:

 

data mergemnl(keep=pid decision mode c1 c2 c3 p d f);
set final1;
array pvec{4} p1 p2 p3 p4;
array dvec{4} d1 d2 d3 d4;
array fvec{4} f1 f2 f3 f4; 
array s1{4}(1 0 0 0);
array s2{4}(0 1 0 0);
array s3{4}(0 0 1 0);

retain pid 0;
pid + 1;
do i = 1 to 4;
mode = i;
p = pvec{i};
d = dvec{i};
f = fvec{i};
c1 = s1{i};
c2 = s2{i};
c3 = s3{i};
decision = ( brandnum = i );
output;
end;
run;

 

This is the code I used to run mdc:


proc mdc data=mergemnl;
model decision =c1 c2 c3 p d f /
type=clogit
nchoice = 4
optmethod=qn
covest=hess;
id pid;
run;

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

Message was moved to procedure thread and title shortened.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 582 views
  • 0 likes
  • 2 in conversation