BookmarkSubscribeRSS Feed
JeffNCSU
Calcite | Level 5
Data1

time x y
11:00 2 3
11:03 4 5
11:07 10 30
12:00 30 20
12:03 21 4
..............

Data2
TimeStart TimeEnd
11:00 11:07
11:03 12:00
12:00 12:03
....................

Want to get results
TimeStart TimeEnd MeanX meanY
11:00 11:07 ? ?
11:03 12:00 ? ?
12:00 12:03 ? ?
............................
1 REPLY 1
Robert_Bardos
Fluorite | Level 6
You could solve this programmatically by

a) putting DATA1 into a hash with TIME as key
b) iterate over DATA2 using both time values to find the relevant hash elements and doing the mean calculation

Others having SAS at their hands might chime in with some ready-to-use code.

(Note that this solution largely depends on the size of DATA1. If it is a very big dataset consider defining/using DATA1 as a dataset indexed on TIME).

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 1 reply
  • 1180 views
  • 0 likes
  • 2 in conversation