BookmarkSubscribeRSS Feed
lmt88
Calcite | Level 5

Hello,

 

I have a what I believe is a really simple question. I don't work in SAS very often, and am trying to use it to gain more comfort with basic functions

 

I am trying to plot a Von Bertalanffy growth equation Lt=Linf*(1-exp(-k*(age-t0))) where Lt is length at age t. I am working with fish, and want to use this plot to find what length they would be expected to be at age 1-20.

 

The parameters for the equation are Linf=900, k=0.15, t0=-0.99

 

 Below is my failed attempt at plotting the equation. Clearly I'm off base. I'd appreciate help in getting it to plot, and finding lengths at age.
Thank you!

 

 

Data VonBert;

Input Linf k t0;

datalines;

900 0.15 -0.99

;

run;

proc plot data=VonBert;

plot Linf*(1-exp(-k*(age-t0)));

run;

 

1 REPLY 1
Astounding
PROC Star

I can give you a couple of pieces ... perhaps enough that you can figure the rest.

 

PROC PLOT is expecting to see variable names, not equations.  So your DATA step has to calculate all the variables, and all the points of interest.  Something like this:

 

Data VonBert;

Input Linf k t0;

do time=1 to 20;

   Lt= some formula goes here;

   output;

end;

datalines;

900 0.15 -0.99

;

 

Then plot what I think would be Lt on the Y axis and Time on the x axis:

 

proc plot data=vonbert;

plot Lt * time;

run;

 

This may not be the entire answer, but it's a step forward.

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
  • 1 reply
  • 1576 views
  • 2 likes
  • 2 in conversation