Fluorite | Level 6

## plot the model that obtain by proc nlmixed

Hi every one

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;

thank u very much

2 REPLIES 2
Super User

## Re: plot the model that obtain by proc nlmixed

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.

SAS Super FREQ

## Re: plot the model that obtain by proc nlmixed

@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.

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