BookmarkSubscribeRSS Feed
APatricio
Calcite | Level 5

All,

I understand that proc nlmixed do not have the class statement option. I need help to code a categorical variable Var5 with six levels: Ind_A, Ind_B, Ind_C, Ind_D, Ind_E, Ind_F.

The following is the code which uses 4 explanatory variables:

proc nlmixed data=data;

     parms b0=x b1=x b2=x b3=x b4=x

             gm1=x gm=x;

     w=b0+b1*Var1+b2*Var2+b3*Var3+b4*Var;

     ww=w+gm1*t;

     consigma=gm2;

     model Y~normal(ww,consigma);

     random t~normal(0,1) subject=group;

     predict ww out= output (keep=Y pred );

run;


The model converges but I need to incorporate the categorical variable.

Any suggestions?

1 REPLY 1
SteveDenham
Jade | Level 19

PROC GLMMOD.

proc glmmod data=data outdesign=want;

class var5;

model y=var1 var2 var3 var4 var5;

run;

You'll probably want to go in and rename the variables in the 'want' dataset, as they will be named col1, col2, etc.

Steve Denham


sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1547 views
  • 0 likes
  • 2 in conversation