LIMO-EEG-Toolbox / limo_tools

Hierarchical Linear Modelling for MEEG data
https://limo-eeg-toolbox.github.io/limo_meeg/
Other
58 stars 28 forks source link

limo_trimci vs. limo_trimmed_mean #167

Closed NirOfir closed 11 months ago

NirOfir commented 11 months ago

I noticed that limo_random_robust relies on two functions in one-sample t-tests. First, mean, CIs etc. are computed using limo_trimci: https://github.com/LIMO-EEG-Toolbox/limo_tools/blob/37b82ad1ac29b3f3e09a377e3bd22b26d3290960/limo_random_robust.m#L182-L183 Then, the data is centered using limo_trimmed_mean: https://github.com/LIMO-EEG-Toolbox/limo_tools/blob/37b82ad1ac29b3f3e09a377e3bd22b26d3290960/limo_random_robust.m#L220 Next, the H0 bootstraps are made on the centered data using limo_trimci: Toolbox/limo_tools/blob/37b82ad1ac29b3f3e09a377e3bd22b26d3290960/limo_random_robust.m#L236

When I looked into the functions I saw that limo_trimci uses winsorised data (replacing the edges by the closest value) and limo_trimmed_mean uses the truncated mean (removing and not replacing the edges of the data). Since the trimmed and winsorised means are not identical, I wondered if it matters that the method for computing the p-values and centering the data are not the same.

Thanks!

CPernet commented 11 months ago

winsorised data are not used to compute the mean - only the variance see https://github.com/LIMO-EEG-Toolbox/limo_tools/blob/v3.4/limo_trimci.m#L69 -- mean of data within bounds having those two functions is confusing but necessary, speeds things up conciderably

NirOfir commented 11 months ago

Ok, thanks.