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-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
  • 0 replies
  • 516 views
  • 0 likes
  • 1 in conversation