BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi, I have some problems with Proc NLMIXED. I have coded a two part model with general likelihood. But I am wondering if there is a simple way to deal with categorical variables in Proc NLMIXED? Just like the CLASS statement in other Proc.

Also I wish to do model selection in the future. But how can I code a macro to do automatic model selection?

Thanks!


proc nlmixed data= “…” TECH=dbldog;

parms b00=0 b10=0 b20=0 b30=0 b40=0 b0=0 b1=0 b2=0 b3=0 b4=0 sigma=1 delta=-2;
Z1=b0 + b1*x1 + b2*x2 + b3*x3 + b4*x4;
Z0=b00 + b10*x1 + b20*x2 + b30*x3 + b40*x4; temp=SQRT(sigma**2+delta**2);
P0=CDF('normal',-Z0);
if y=0 then P=P0;
else if y^=0 then P=(1-P0)*2/temp*PDF('normal',(y-Z1)/temp)*CDF('normal',delta/sigma*(y-Z1)/temp);
ll=log(P);
model y~GENERAL(ll);
bounds sigma>0;
run;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 0 replies
  • 742 views
  • 0 likes
  • 1 in conversation