Statistical Procedures

Programming the statistical procedures from SAS
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ukhan
Obsidian | Level 7

I am using the von Bertalanffy growth function (VBGF), but the PROC STATEMENT does not provide model fitness parameters such as AIC, BIC, RMSE, and R2? Need help to revise the PROC STATEMENT.

FILENAME REFFILE '/home/u58890255/Growth  functions/sample_data.xlsx';
PROC IMPORT DATAFILE=REFFILE
	DBMS=XLSX
	OUT=WORK.IMPORT;
	GETNAMES=YES;
RUN;
PROC CONTENTS DATA=WORK.IMPORT; RUN;

title 'von Bertalanffy growth function';
data exp;
set WORK.IMPORT;
if expno=1;
run;
proc nlin data=exp method=marquardt;
parms Linf=190 k=0.05 t0=-1.5;
model sl=Linf*(1-exp(-k*(age-t0)));
output out=expp p=pLinf r=Linf_residual;
run;

Using the following PROC STATEMENT,  I can calculate the adjusted R2 for a Nonlinear regression model, but this time the following PROC also does not provide any result

proc summary data=expp;
     var Linf_residual Linf;
     output out=stats css(Linf)=sstot uss(Linf_residual)=ssres N=N;
run;
data expp;
     set stats;
     rsquared=1-(ssres/sstot);
     adjrsquared = 1-(1-rsquared)*(N-1) / (N- 3  -1);
run;
proc print data=expp;
run; 

Kind regards,

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

Use PROC NLMIXED instead of PROC NLIN - it's a bit more flexible (particularly if the response is not normal) and provides AIC and BIC. For an R-square, you can use the generalized R-square discussed in this note

proc nlmixed data=import;
where expno=1;
m=Linf*(1-exp(-k*(age-t0)));
model sl~normal(m,s);
predict m out=out;
run;
data out; set out;
res=sl-pred;
run;
proc sql; 
select 1-(uss(res)/css(sl)) as R2 from out;
quit;

View solution in original post

5 REPLIES 5
sbxkoenk
SAS Super FREQ

Success! We moved this post to "statistical_procedures" board.

StatDave
SAS Super FREQ

Use PROC NLMIXED instead of PROC NLIN - it's a bit more flexible (particularly if the response is not normal) and provides AIC and BIC. For an R-square, you can use the generalized R-square discussed in this note

proc nlmixed data=import;
where expno=1;
m=Linf*(1-exp(-k*(age-t0)));
model sl~normal(m,s);
predict m out=out;
run;
data out; set out;
res=sl-pred;
run;
proc sql; 
select 1-(uss(res)/css(sl)) as R2 from out;
quit;
ukhan
Obsidian | Level 7

Great, it works perfectly. Kind of you @StatDave. Could you please also explain what is the new parameter “s” (please check the attached screenshot)?Screenshot 2022-01-23 102149.png

 

Ksharp
Super User
According to code " sl~normal(m,s) " ==> s is the std of normal .
ukhan
Obsidian | Level 7
Thank you so much for the help 🙂

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

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
  • 5 replies
  • 3720 views
  • 6 likes
  • 4 in conversation