Programming the statistical procedures from SAS

Proc BCHOICE ERROR

Reply
New Contributor
Posts: 2

Proc BCHOICE ERROR

Hello,

I am trying to run the following code (very similar to the example on the proc Bchoice page):

proc bchoice data=SumStd outpost=b seed=123 nbi=100 thin=10 nmc=800 diag=(AutoCorr ESS MCSE) stats=ALL dic nthreads=4;

class Panel_ID DAY;

model Best_Overall  = / choiceset=(Panel_ID DAY);

random X1 X2 / subject=Panel_ID remean type=un monitor ;  

ods output PostIntervals=PostInt123b PostSummaries=Postsumry123b DIC=DIC123b;

run;

But I get the following error message:

38   proc bchoice data=SumStd outpost=Postsamp seed=123 nmc=400 thin=4

NOTE: The BCHOICE procedure is experimental in this release of the SAS system.

39                alg=rwm nthreads=4;

40      class Panel_ID DAY;

41      model Best_Overall = / choiceset=(Panel_ID DAY);

42      random X1 X2 X3 X4/ sub=Panel_ID remean

43             monitor=(1 to 5) type=un;

44   run;

ERROR: The observations for the same value of SUBJCET= variable must be together in the input

data set.

NOTE: The SAS System stopped processing this step because of errors.

WARNING: The data set WORK.POSTSAMP may be incomplete.  When this step was stopped there were

         0 observations and 0 variables.

NOTE: PROCEDURE BCHOICE used (Total process time):

      real time           0.06 seconds

      cpu time            0.04 seconds

Any ideas why?

Thank you!

Sigrid

Respected Advisor
Posts: 2,655

Re: Proc BCHOICE ERROR

I've never run BCHOICE, but I suspect that using a PROC SORT on the dataset might help, sorting by Panel_ID and day.  Also, be very sure that the Panel_ID values are unique, so that there are no "duplicates" in the data.

Steve Denham

New Contributor
Posts: 2

Re: Proc BCHOICE ERROR

Hi Steve,

thank you for your message. I have sorted the data and there are no duplicates.

However there is something weird. The code runs on the 32bits version of SAS 9.4, but not on the 64bits.

Not sure why...

Sigrid

Respected Advisor
Posts: 2,655

Re: Proc BCHOICE ERROR

You will definitely want to open a ticket with Tech Support on this, so it will go into the known bugs that they need to fix.

Steve Denham

New Contributor
Posts: 2

Re: Proc BCHOICE ERROR

You may try:

data SumStd;

set SumStd;

format Panel_ID DAY;

informat Panel_ID DAY;

run;

proc sort;

by Panel_ID DAY;

run;

 

I had the same error and it helped

Zbig

SAS Employee
Posts: 6

Re: Proc BCHOICE ERROR

data SumStd;

set SumStd;

format Panel_ID DAY;

informat Panel_ID DAY;

run;

 

The above DATA step is to remove the format applied on Panel_ID and DAY.  Then BCHOICE in SAS/STAT 13.1 will run fine.

 

In newer versions (SAS/STAT 13.2, 14.1, and 14.2), this problem has been fixed, and you don't even need to sort subjects.

 

 

Amy Shi

email: amy.shi@sas.com

Senior Research Statistician Developer

Bayesian Statistical Modeling

Advanced Analytics Division (R&D-AA)

SAS

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