turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- How do I plot a growth equation?

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-23-2016 06:50 PM

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**;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-23-2016 07:37 PM

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.