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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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