BookmarkSubscribeRSS Feed
Demographer
Pyrite | Level 9

Hello,

I would like to set a reference value to some independant variables in a mixed logit regression using PROC MDC.

Thus, I tried to use the class statement the same way as in the PROC LOGISTIC:

class x1(ref='1') /param=ref;

However, the error 22-322 appears, saying:

"Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_."

What's wrong? Is it allow to specify a reference value with proc MDC? Note that the class statement used without specifying a reference value works fine.

Thanks

6 REPLIES 6
SteveDenham
Jade | Level 19

If you don't specify a reference value, which level of the class variable is used by default?  If it is last or first, create a variable that will sort to that position, and sort the data prior to analysis.  This is what we had to do before you could specify a reference level in the class statement, and it appears that is the case for this instance of the CLASS statement.  Implementation of the CLASS statement in SAS/ETS procedures is not as cohesive as it is in SAS/STAT procedures--only COUNTREG and SEVERITY allow for the specification of reference levels.

Steve Denham

Demographer
Pyrite | Level 9

Good idea. However, after some tests, I think there is a problem with the class statement using proc MDC (type=mixedlogit). In the results, there is a parameter for the reference value, which is a non-sense. Moreover, this parameter has no standard error. I really don't get why.

I think I'll just create dummy variables.

SteveDenham
Jade | Level 19

Use of the CLASS statement, and the results from the solution vector are often confusing.  If the parameterization is a full rank parameterization, then there will be estimate values for all levels presented, but at least one will not be included.  If the parameterization is non-full rank (GLM type), then one level will have a zero estimate, without a standard error.

Can you share the output?

Steve Denham

Demographer
Pyrite | Level 9

Thanks. I cannot share the output because I work in a secure lab. The version of SAS I use at home doesn't support the class statement in proc MDC, si I can't reproduce. The syntax is basic, such as:

Suppose variable "a" has 3 categories.

proc mdc;

class=a;

model y = a b c/

type=mixedlogit nchoice=10 mixed=(normalparm=a);

id id;

run;

I'm not very familiar with concepts such as full rank parameterization.

SteveDenham
Jade | Level 19

I think you need to open a ticket with Tech Services where you can present the exact output in a confidential setting.  I have tried three different datasets and cannot produce an error in the output starting with the example data and code for PROC MDC.

Steve Denham

Rick_SAS
SAS Super FREQ

That's the same answer I gave several days ago. For reference, here is the cross-post: https://communities.sas.com/thread/86212

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
  • 6 replies
  • 2069 views
  • 6 likes
  • 3 in conversation