[SciPy-User] ttest_rel with unequal groups

Hjalmar Turesson hturesson at gmail.com
Thu Nov 7 04:52:57 EST 2013


Hi,

If I'm not confused, ttest_rel is a paired samples ttest (
http://en.wikipedia.org/wiki/Paired_difference_test), and thus requires
that all samples are paired (this does not depend on the particular scipy
implementation).
If occasional samples in a group are missing, and you still want perform
the paired ttest, then you will probably have to exclude the corresponding
sample in the other 2nd, or generate pseudo-values to replace the missing
values in the 1st group. Alternatively, you can use ttest_ind (
http://en.wikipedia.org/wiki/Ttest#Independent_samples), which doesn't
require exactly the same number of samples in the two groups.


On Thu, Nov 7, 2013 at 2:18 AM, Horea Christian <h.chr at mail.ru> wrote:

> Hey there! I would like to use the ttest_rel function to compare
> reaction times for two conditions tested over 10 participants. We have
> done 100 trials per participant, but some of them had errors and were
> excluded. For instance for prticipants 1 and 2 I have condition1: 95
> trials, condition2: 100 trials AND condition1:100 trials and condition2:
> 99 trials.
>
> depending on whether or not I transpose my dataframe I get a complaint
> either at
>
>      if a.shape[axis] != b.shape[axis]:
>          raise ValueError('unequal length arrays')
>
> or at
>
>      d = (a - b).astype(np.float64)
>
> .
>
>
> What can I do about this? I found it surprising that it doesn't "just
> work" since in most experiments it is expected for some of the
> measurements to fail.
>
> Many Thanks!
> Christian
>
> --
> Horea Christian
> http://chymera.eu
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20131107/10721402/attachment.html>


More information about the SciPy-User mailing list