Programming the statistical procedures from SAS

Setting a reference value with the class statement using proc MDC

Reply
Frequent Contributor
Posts: 111

Setting a reference value with the class statement using proc MDC

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

Respected Advisor
Posts: 2,655

Re: Setting a reference value with the class statement using proc MDC

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

Frequent Contributor
Posts: 111

Re: Setting a reference value with the class statement using proc MDC

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.

Respected Advisor
Posts: 2,655

Re: Setting a reference value with the class statement using proc MDC

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

Frequent Contributor
Posts: 111

Re: Setting a reference value with the class statement using proc MDC

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.

Respected Advisor
Posts: 2,655

Re: Setting a reference value with the class statement using proc MDC

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

SAS Super FREQ
Posts: 3,537

Re: Setting a reference value with the class statement using proc MDC

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

Ask a Question
Discussion stats
  • 6 replies
  • 498 views
  • 6 likes
  • 3 in conversation