Learner
Posts: 1

# How do I plot a growth equation?

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;

Super User
Posts: 5,717

## Re: How do I plot a growth equation?

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.

Discussion stats