Comparing two samples with not independent observations within each one


I would appreciate your advice.

I have the following experimental design: I measure the heartbeat of a person while he/she listens to music. The hypothesis is that the louder music will result in higher heartbeat rate. So, a subject listens for 30 min classical piece while measuring heart-beats. The data (both audio volume and heartbeat) is segmented into segments of 5 sec (360 segments in total). Within each segment I average volume and heart-beat rate. Now, I find 10% of segments with highest volume (36 segments; red shadow on the attached plot) and 10% of segments with the lowest volume (36 segments; green shadow on the attached plot) . I compare the heart-beat rate between high and low volume periods (two-sample t-test). My question is how problematic is that in my data there are sequences of segments (e.g., 10 segments in a row). So, to some extent the observation in each samples are are independent. What statistical method should be applied in such case? Instead of segmenting the data, I can run the correlation between volume and heartbeat trace. But I think that this analysis will suffer from the same problem.

Many thanks!



Well-Known Member
The volume 1 segment ago and 2 segments ago (or more) may also influence the heartbeat.
Maybe check for "time series"?