Hi, are you able to post the first few observations of the datasets? It seems like you need to
PROC MEANS DATA=my_dataset (WHERE = (announcement_date >= INTCK('DAY',announcement_date,-125,'s')) STD MEAN;
VAR rate;
RUN;
3000285MM | Air Methods Corp. | American Securities LLC | 11641 | 03/14/2017 | Complete | . | 04/21/2017 | 1 | Cash | 0 | 1 | 0 | 0 | 0 | 0 | 1789 | 2376 | 0 | 1 | 0 | . | 0 | 1163 | 0 | 0 | 12 | 12 | TRANS | OTHER |
2 | 3000547MM | KCG Holdings, Inc. | Virtu Financial, Inc. | 13998 | 03/15/2017 | Complete | . | 07/20/2017 | 0 | Cash | 0 | 1 | 0 | 0 | 0 | . | 6261 | 5794 | -0 | 1 | 0 | . | 0 | 1142 | 0 | -0 | 11 | 11 | FIN | FIN |
3 | 3001983MM | Stonegate Bank | Home Bancshares, Inc. (Arkansas) | 14671 | 03/27/2017 | Complete |
1 | 06/30/2002 | 1.73 |
2 | 07/01/2002 | 1.83 |
3 | 07/02/2002 | 1.72 |
4 | 07/03/2002 | 1.71 |
5 | 07/04/2002 | 1.71 |
6 | 07/05/2002 | 1.72 |
7 | 07/06/2002 | 1.72 |
8 | 07/07/2002 | 1.72 |
9 | 07/08/2002 | 1.75 |
10 | 07/09/2002 | 1.72 |
11 | 07/10/2002 | 1.74 |
12 | 07/11/2002 | 1.76 |
Hi. Can you see the table? I wonder if you can show me how to join two tables as well
here are two screenshots of them
It is assumed that both the datasets can be joined using "Announcement Date" in dataset1 and "Date" in dataset2. I could not find an ID Variable in dataset2:
proc sql;
create table dsn as
select data1.deal_id,data1.announcement_date,data2.date,data2.rate
from dataset1 as data1
inner join /* Assuming we only need common observations i.e. which exists in both datasets*/
dataset2 as data2
on data1.announcement_date = data2.date;
quit;
PROC MEANS DATA=dsn(WHERE=(nannouncement_date >= INTCK('DAY',announcement_date,-125,'s'))) STD MEAN;
VAR rate;
RUN;
So in the announcement_date dataset, there are 640 observations while in the rate dataset there are 40,000+ observations. So I don't know how to join them. Basically, I need to find the average rate for 640 deals which range 125 days before the announcement date. I don't know if it makes sense?
Sorry, but screenshots are even more useless than tables. Both don't show relevant information like variable types, length etc. So please take your time and post data in usable form. Have a look at How to convert datasets to data steps if you don't know what to do.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.