How to correctly do a Student Test for atmoshperic data
1 view (last 30 days)
Show older comments
Luis Jesús Olvera Lazcano
on 27 Sep 2023
Commented: Star Strider
on 30 Sep 2023
I've been having some troubles to understand how to do a ttest over my data.
I have an OLR netcdf with dimensions 180 x 51 x 14245, i.e., lon x lat x time. I filtered this data with a bandpass of 20 to 70 days. After that, I select an specified number of times to analyze my phenomena. That way, I select 30 events with that phenomena, with 31 times each event, having dimensions 180 x 51 x 31 x 30. Finally, I calculated the mean over the number of events to obtain only 180 x 51 x 30.
I want to see which data has significative differences compared with the original OLR file (unfiltered), to plot only the statistically significant values with pcolor.
My code was this one:
for i=1:180
for j=1:51
k = olr_event(i,j,:); % olr_event is the composite olr data I mentioned before
l = olr_orig(i,j,:); % olr_orig is the original olr data with 14245 times
prueba = ttest2(k,l);
end
end
The problem is that the whole area rejects the null hypothesis, meaning that each grid point has statistical differences, which I dont really expect.
Am I doing it correctly?
Thank you!
0 Comments
Accepted Answer
Star Strider
on 27 Sep 2023
I’m not certain what you’re doing. I would use ttest2 on the filtered and unfiltered events themselves (since that is how ttest2 works), not test one event against the mean of the other.
Testing the effect of filtering on the signals themselves —
t = (0 : 150);
x = randn(size(t))
y = randn(size(t))+0.1
yf = bandpass(y, [0.30 0.31], 1, 'ImpulseResponse','iir');
[h1,p1] = ttest2(x, y) % Unfiltered
[h2,p2] = ttest2(x, yf) % Filtered
It is certainly possible that the filter removes enough of the signal energy to result in a statistically significant difference.
.
2 Comments
More Answers (0)
See Also
Categories
Find more on EEG/MEG/ECoG in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!