meaning of pg.compute_bootci() with custom function #274
-
This is the dataset: Prep work:
I am trying to bootstrap a confidence interval for the difference in means between pg1 and pg2. Here's the "manual" version:
Here's what I think is the equivalent via Pingouin:
Why are the histograms so different? The distribution returned by |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Another question is that the confidence interval returned by
Which gives:
In the past, I've noticed |
Beta Was this translation helpful? Give feedback.
-
@FlorinAndrei please see the source code of Pingouin here: Lines 343 to 363 in 8825a21 A few differences:
As for the different confidence intervals, please refer to the source code, which should hopefully be self-explanatory: Lines 365 to 393 in 8825a21 For the unit tests of the confidence intervals against Matlab, see: pingouin/pingouin/tests/test_effsize.py Lines 80 to 94 in 8825a21 |
Beta Was this translation helpful? Give feedback.
-
Quick question: if |
Beta Was this translation helpful? Give feedback.
-
@FlorinAndrei you are right — I have just looked at the implementation of the recently-added scipy.stats.bootstrap and they indeed do resample each group separately when
I'll open an issue for this. Thanks |
Beta Was this translation helpful? Give feedback.
@FlorinAndrei you are right — I have just looked at the implementation of the recently-added scipy.stats.bootstrap and they indeed do resample each group separately when
paired=False
, which makes more sense because otherwise you're discarding data ifx
andy
do not have the same length. My implementation was based on Matlab's bootci which only support the case wherex
andy
have the same length:I'll open an issue for this. Thanks