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
- /
- SAS Programming
- /
- SAS Procedures
- /
- Growth Curve Analysis in SAS.

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

09-10-2009 02:00 AM

I have a table that looks like this :

an id duration wt

7401-2001 0 129

7401-2001 167 540

7401-2001 198 652

7401-2001 224 680

7401-2001 246 715

7401-2002 0 94

7401-2002 133 416

7401-2002 169 556

7401-2002 203 644

7401-2002 226 700

7401-2002 247 723

and so on.

The 'anid' is a categorical variable. The goal is to calculate the slope for each anid treating duration as X and weight as Y. That is, a linear regression for each anid.

There are 2000 data rows and 500 different anids. I ran a GLM code on it but this gives me the same slope for each anid , with different intercepts.

I specifically require different slopes for different anids for further growth curve analysis. How to go about it? Please help.

an id duration wt

7401-2001 0 129

7401-2001 167 540

7401-2001 198 652

7401-2001 224 680

7401-2001 246 715

7401-2002 0 94

7401-2002 133 416

7401-2002 169 556

7401-2002 203 644

7401-2002 226 700

7401-2002 247 723

and so on.

The 'anid' is a categorical variable. The goal is to calculate the slope for each anid treating duration as X and weight as Y. That is, a linear regression for each anid.

There are 2000 data rows and 500 different anids. I ran a GLM code on it but this gives me the same slope for each anid , with different intercepts.

I specifically require different slopes for different anids for further growth curve analysis. How to go about it? Please help.

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

Posted in reply to deleted_user

09-10-2009 12:22 PM

Fit a linear model within anid and then output the parameters.

e.g.

PROC GLM;

BY anid;

MODEL wt=duration;

You can output the slope an intercept with either ODS or an OUTPUT statement. The classical growth curve analysis (Wishert), requires the same time intervals (number and placement) so you can put all the wt's on the left hand side of the model and fit the curve within the times. IF you have that situation (you don't), this method is algebraically equivalent.

Message was edited by: Doc@Duke

e.g.

PROC GLM;

BY anid;

MODEL wt=duration;

You can output the slope an intercept with either ODS or an OUTPUT statement. The classical growth curve analysis (Wishert), requires the same time intervals (number and placement) so you can put all the wt's on the left hand side of the model and fit the curve within the times. IF you have that situation (you don't), this method is algebraically equivalent.

Message was edited by: Doc@Duke

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

Posted in reply to Doc_Duke

09-10-2009 07:27 PM

Thanks for the reply. It worked great. I have worked on logistic models before, its my first tryst with ODS output.

I am trying to get the output into excel. ODS gives a lot of options. But each of them has a lot of unwanted result. The final excel table I am looking to compile has only 3 columns:

an id, slope, intercept

Thats it. Anyway I can just extract slope and intercept only from the output and chuck the other inferences which I do not need at the moment?

With 4 other files like this, I am looking at a formatting nightmare otherwise!!

Thanks again.

I am trying to get the output into excel. ODS gives a lot of options. But each of them has a lot of unwanted result. The final excel table I am looking to compile has only 3 columns:

an id, slope, intercept

Thats it. Anyway I can just extract slope and intercept only from the output and chuck the other inferences which I do not need at the moment?

With 4 other files like this, I am looking at a formatting nightmare otherwise!!

Thanks again.