BookmarkSubscribeRSS Feed
sigrid
Calcite | Level 5

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

5 REPLIES 5
SteveDenham
Jade | Level 19

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

sigrid
Calcite | Level 5

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

SteveDenham
Jade | Level 19

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

zk117
Calcite | Level 5

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

amyshi
SAS Employee

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1690 views
  • 0 likes
  • 4 in conversation