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,
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;
Success! We moved this post to "statistical_procedures" board.
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;
Great, it works perfectly. Kind of you @StatDave. Could you please also explain what is the new parameter “s” (please check the attached screenshot)?
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.