I don't find it immediately obvious how these datasets relate. Let me ask a few questions:
Do RR_s and Stages have a firm match on ID, night, and epoch? If that's the case, you can use this code to join them (I find PROC SQL is a better solution for this kind of problem than data step merges).
proc sql noprint;
create table Merged1 as
select r.ID, r.Night, r.epoch, s.stages, r.RR_s
from RR_S r full outer join Stages s
on(r.ID = s.ID and r.Night = s.Night and r.epoch = s.epoch)
order by r.ID, r.Night, r.epoch;
quit;
If that's the case, how do ID, night, and x on HR relate to ID, night, and epoch on the merged file?
Using ID of RES005 and night of BN, the first unique values of Time on HR are: 0:00:00 0:02:00 0:03:00 0:04:00 0:05:00 0:06:00 0:07:00 0:08:00 0:09:00 0:10:00
while the first unique values of epoch on the merged file are 1 through 10, each with many records. What is the logic to match these variables?
Tom
... View more