BookmarkSubscribeRSS Feed
RazzleBayker
Calcite | Level 5

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:


     DATE

(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.

2 REPLIES 2
Reeza
Super User

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;

run;

RazzleBayker
Calcite | Level 5

Thank you so much.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 689 views
  • 3 likes
  • 2 in conversation