BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

I am using Bchoice and find the error in Choicetype when I estimate allocation model. I have used my data as well as data and code from Example 9 for Proc Bchoice (allocation model) and Example 8 for Bchoice (MaxDiff choice). It appears the same error below. Please help!

 

======= I run the example 9 (allocation model) as code and error below:

 

6946 proc bchoice data=MAMR seed=124 nthreads=8 nmc=20000 nthin=2 plots=none;
6947 class TrtScheme(ref=first) RespRate Time Status TrtLine Risk Cost ID Set
6948 / ref=last;
6949 model Alloc = / choiceset=(ID Set) Choicetype=ALLOCATION;
----------
22
202
ERROR 22-322: Syntax error, expecting one of the following: ;, ALTERIDX, CHOICESET, COEFFPRIOR, COVPRIOR, COVTYPE,
CPRIOR, INIT, INITIAL, LAMBDAPRIOR, LPRIOR, NEST, SAMELAMBDA, TYPE.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
6950 random TrtScheme RespRate Time Status TrtLine Risk Cost
ERROR: Variable ALLOCATION not found.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

14.1 doesn't support that code and the example isn't in the documentation - make sure to use the correct documentation for your installation. 

 

You can request an upgrade - that's included with your licensing fees.

View solution in original post

7 REPLIES 7
Reeza
Super User

What version of SAS are you using? If you're not sure run the following code and see what the results are in the log:

 

proc product_status;run;

@thongtiennguyen wrote:

I am using Bchoice and find the error in Choicetype when I estimate allocation model. I have used my data as well as data and code from Example 9 for Proc Bchoice (allocation model) and Example 8 for Bchoice (MaxDiff choice). It appears the same error below. Please help!

 

======= I run the example 9 (allocation model) as code and error below:

 

6946 proc bchoice data=MAMR seed=124 nthreads=8 nmc=20000 nthin=2 plots=none;
6947 class TrtScheme(ref=first) RespRate Time Status TrtLine Risk Cost ID Set
6948 / ref=last;
6949 model Alloc = / choiceset=(ID Set) Choicetype=ALLOCATION;
----------
22
202
ERROR 22-322: Syntax error, expecting one of the following: ;, ALTERIDX, CHOICESET, COEFFPRIOR, COVPRIOR, COVTYPE,
CPRIOR, INIT, INITIAL, LAMBDAPRIOR, LPRIOR, NEST, SAMELAMBDA, TYPE.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
6950 random TrtScheme RespRate Time Status TrtLine Risk Cost
ERROR: Variable ALLOCATION not found.

 

 




Reeza
Super User
Also, please run the exact code from here in a clean session and post your full log.
http://documentation.sas.com/api/docsets/statug/14.3/content/statug_code_bchcex9.htm?locale=en
thongtiennguyen
Calcite | Level 5

Hi Reeza,

 

I am using Sas 9.4. 

 

I have run your suggested codes but it does't work. Below are logs. Thank you very much for help!

 

=====

 


3 /*-----------------------------------------------------------------
4 S A S S A M P L E L I B R A R Y
5
6 NAME: BCHCEX9
7 TITLE: Documentation Example 9 for PROC BCHOICE
8 Allocation choice example
9 PRODUCT: STAT
10 SYSTEM: ALL
11 KEYS:
12 PROCS: BCHOICE
13 DATA:
14
15 SUPPORT: Amy Shi
16 REF: PROC BCHOICE, EXAMPLE 9
17 MISC:
18 -----------------------------------------------------------------*/
19
20 data MAMR;
21 input ID Set None TrtScheme RespRate Time Status TrtLine Risk Cost Alloc @@;
22 datalines;

NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
NOTE: The data set WORK.MAMR has 5852 observations and 11 variables.
NOTE: DATA statement used (Total process time):
real time 0.22 seconds
cpu time 0.03 seconds


5875 ;
5876
5877 proc print data=MAMR(obs=20);
NOTE: Writing HTML Body file: sashtml.htm
5878 run;

NOTE: There were 20 observations read from the data set WORK.MAMR.
NOTE: PROCEDURE PRINT used (Total process time):
real time 1.08 seconds
cpu time 0.54 seconds


5879
5880 proc bchoice data=MAMR seed=124 nthreads=8 nmc=20000 nthin=2 plots=none;
5881 class TrtScheme(ref=first) RespRate Time Status TrtLine Risk Cost ID Set
5882 / ref=last;
5883 model Alloc = / choiceset=(ID Set) choicetype=allocation;
----------
22
202
ERROR 22-322: Syntax error, expecting one of the following: ;, ALTERIDX, CHOICESET, COEFFPRIOR, COVPRIOR, COVTYPE,
CPRIOR, INIT, INITIAL, LAMBDAPRIOR, LPRIOR, NEST, SAMELAMBDA, TYPE.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
5884 random TrtScheme RespRate Time Status TrtLine Risk Cost
ERROR: Variable ALLOCATION not found.
NOTE: PROCEDURE BCHOICE used (Total process time):
real time 0.18 seconds
cpu time 0.00 seconds

NOTE: The SAS System stopped processing this step because of errors.
5885 / subject=ID remean;
5886 run;

 

 

 

Reeza
Super User

Sorry, I need you SAS/STAT version. I suspect you're using an older version (14.1 or 13.1?) that doesn't support this PROC with the option in the example. 

 

 

thongtiennguyen
Calcite | Level 5

Dear Reeza,

 

Yes, I think I use version 14.1. Below are results from running your log. What should I do? Much appreciated!

 

 

proc product_status;run;

For Base SAS Software ...
Custom version information: 9.4_M3
Image version information: 9.04.01M3P062415
For SAS/STAT ...
Custom version information: 14.1
For SAS/GRAPH ...
Custom version information: 9.4_M3
For SAS/ETS ...
Custom version information: 14.1
For SAS/FSP ...
Custom version information: 9.4_M3
For SAS/OR ...
Custom version information: 14.1
For SAS/AF ...
Custom version information: 9.4_M3
For SAS/IML ...
Custom version information: 14.1
For SAS/QC ...
Custom version information: 14.1
For SAS/ASSIST ...
Custom version information: 9.4
Image version information: 9.04.01M0P061913
For SAS/CONNECT ...
Custom version information: 9.4_M3
For SAS/ACCESS Interface to Netezza ...
Custom version information: 9.4_M3
For SAS/ACCESS to Hadoop ...
Custom version information: 9.43
For SAS Enterprise Miner ...
Custom version information: 14.1
For SAS/ACCESS to Vertica ...
Custom version information: 9.4_M3
For SAS/ACCESS to Postgres ...
Custom version information: 9.4_M3
For SAS/ACCESS to Impala ...
Custom version information: 9.42
Image version information: 9.04.01M0P062415
For SAS/ACCESS Reserved Slot 568 ...
Custom version information: 9.4
Image version information: 9.04.01M0P040616
For SAS Integration Technologies ...
Custom version information: 9.4_M3
For High Performance Suite ...
Custom version information: 2.2_M4
For SAS/ACCESS Interface to DB2 ...
Custom version information: 9.4_M2
For SAS/ACCESS Interface to Oracle ...
Custom version information: 9.4_M3
For Interface to the PI System ...
Custom version information: 9.41
Image version information: 9.04.01M0P020316
For SAS/ACCESS Interface to Sybase ...
Custom version information: 9.4_M2
For SAS/ACCESS Interface to PC Files ...
Custom version information: 9.4_M3
For SAS/ACCESS Interface to ODBC ...
Custom version information: 9.4_M3
For SAS/ACCESS Interface to OLE DB ...
Custom version information: 9.4_M3
For SAS/ACCESS Interface to Teradata ...
Custom version information: 9.43
For SAS/ACCESS Interface to MySQL ...
Custom version information: 9.4_M3
NOTE: PROCEDURE PRODUCT_STATUS used (Total process time):
real time 0.49 seconds
cpu time 0.11 seconds

 

Reeza
Super User

14.1 doesn't support that code and the example isn't in the documentation - make sure to use the correct documentation for your installation. 

 

You can request an upgrade - that's included with your licensing fees.

thongtiennguyen
Calcite | Level 5

Thank a lot. I did not know about it.

Th

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
  • 7 replies
  • 1573 views
  • 1 like
  • 2 in conversation