Help using Base SAS procedures

Help needed: Multiple Regression

Posts: 24

Help needed: Multiple Regression

e Hi guys,

I'm currently working on a data set with millions of observations and I need help running a multiple regression for each day on its own without having to create an individual data set for each day. The same regression needs to be applied to each day individually.  However, I don't want the date itself to be a variable in the regressions.  It is only there for identification purposes as to where to split the data.

Here is a basic example of what my data looks like:


(YYYYMMDD)           A               B              C

-------------------        ----------     ---------      -------

20070103                   4               1             6

20070103                   5               2             1

20070103                   9               7             9

20070103                   5               4             7

20070104                   4               9             6

20070104                   1               5             3

20070104                   1               8             3

20070104                   3               8             7

20070105                   6               9             2

20070105                   0               2             8

20070105                   2               1             5  
etc.                            etc.           etc.           etc.

The only way I can think of running this regression for every single day is to split the data into individual sets (day by day).  However, I have thousands of days that I am looking at and it would be nearly impossible to construct individual data sets and run a regression for each.  Is there any code you know of that would automatically split the data into days and run the regression for each day without the date being a variable within the regression?

I hope my question is clear.

Thanks in advance, I really appreciate your help.

Super User
Posts: 23,689

Re: Help needed: Multiple Regression

Posted in reply to RazzleBayker

make sure its sorted by date and then use it as a by variable in your regression model.

proc reg data=have;

by date;

model a=b c;


Posts: 24

Re: Help needed: Multiple Regression

Thank you so much.

Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation