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


hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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