07-16-2015 06:22 AM
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;
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;
ERROR: The observations for the same value of SUBJCET= variable must be together in the input
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?
07-16-2015 09:38 AM
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.
07-21-2015 03:02 AM
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...
02-13-2017 04:43 PM
format Panel_ID DAY;
informat Panel_ID DAY;
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.
Senior Research Statistician Developer
Bayesian Statistical Modeling
Advanced Analytics Division (R&D-AA)