BookmarkSubscribeRSS Feed
Abbas_Arkawazi
Fluorite | Level 6

Hi every one

please help me with my problem.

I have the model that estimated by proc nlmixed then i need to plot the actual and predicted.

 

proc import datafile='C:\Users\Abbas Arkawazi\Desktop\test.xlsx'
DBMS =xlsx Out=test;
run;
proc nlmixed data=test;
   parms b0= 10 b1=2  b2=.5   b3= 1  a=2 b=1  s=  150 ;
   m = b0+(b1*age)+(b2*gender)+(b3*creatin);
   y=urea;
   if status_u=1 then f=((a*b)*((1-exp(-exp((y-m)/s)))**(a-1))*((1+((exp(exp((y-m)/s))-1)**(a)))**(-(b+1)))) /(s*exp((-a*exp((y-m)/s))-((y-m)/s))) ;
   else f= (1+(((1-exp(-exp((y-m)/s)))/(exp(-exp((y-m)/s))))**a))**-b ;
   ll=log(f);
   model y ~ general(ll);
run;

please help me to plot the estimated model 

thank u very much

2 REPLIES 2
Reeza
Super User
You would first add the PREDICT statement to generate predictions but I'm not sure exactly how you'd specify it for your model. And then use the OUT= option on the PREDICT statement to save the outputs.

You can then use PROC SGPLOT to graph the predicted versus actuals.

StatsMan
SAS Super FREQ

@Reeza is right. Use the PREDICT statement to generate your predicted values. If M is your mean response, then PREDICT M will get you that predicted value.

 

You have 3 covariates in the model though. I am not sure what you will want to use as the X axis for your plot. Perhaps group by GENDER and plot either CREATIN or AGE for a specific value of AGE or CREATIN. 

 

The PREDICT statement will provide predicted values for the observations in your DATA= data set, the input to PROC NLMIXED. To create predicted values for additional observations, you will need to write your own scoring code in a SAS Data step. Your equation for M in your PROC NLMIXED code is your scoring equation. Substitute the parameter estimates from NLMIXED and off you go. 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 992 views
  • 6 likes
  • 3 in conversation