Programming the statistical procedures from SAS

Regression for several models

Reply
Contributor hua
Contributor
Posts: 25

Regression for several models

Hi,

 

Can anyone tell me how to do the regression of different models? 

I have a dataset like this:

id   year  V1  V2  V3  V4  ...  V30

1   2011  30  20  55   28  ...   50

2   2011  28  12  76   13  ...   35    

3   2011  46  22  58   12  ...   46

1   2012

2   2012

3   2012

1   2013

2   2013

3   2013

 

 

I want to do the regression for model V1= year, V2=year,... and V30=year, and by id. And I hope to get the slope, intercept, R2, and p-value of these 30 models. 

 

Thank you!

SAS Super FREQ
Posts: 3,306

Re: Regression for several models

See the article "An easy way to run thousands of regressions in SAS" for an example and working code that you can use.

Contributor hua
Contributor
Posts: 25

Re: Regression for several models

Thank you so much! The article seems like exactly what i want to solve! I will read it to figure out this problem!

SAS Employee
Posts: 187

Re: Regression for several models

Also, see the methods in this note

Contributor hua
Contributor
Posts: 25

Re: Regression for several models

Yes! It seems like I need to use a macro procedure to deal with this problem.This note will help a lot! Thank you for help!

Ask a Question
Discussion stats
  • 4 replies
  • 73 views
  • 0 likes
  • 3 in conversation