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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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