How can I perform a paired sample t test with unequal sample sizes ?

20 views (last 30 days)
Dear all,
I have two samples with different sizes and would like to run a mean difference using a paired t-test,
my problem is that I cannot find any tests proposed on Matlab that allow me to run a paired t-test for samples with unequal sizes.
Thank you for your help !
  5 Comments
Math93
Math93 on 1 Aug 2017
I am just unsure of which category my two samples belong too but they are not a before/after type of sample so I'll consider them as independent.
Thank you for your help José-Luis !
Star Strider
Star Strider on 3 Aug 2017
@Math93 —
Please do not ever create data that do not exist using interpolation (or any other method)!
Data are data, and interpolating just to provide equal sample sizes will lead to unusable results. There are several statistical methods to deal with unequal sample sizes, one of which I mentioned in my Answer.

Sign in to comment.

Accepted Answer

KSSV
KSSV on 1 Aug 2017
Use interp1 and get the data sets to same dimensions.....Read about interp1
  2 Comments
Math93
Math93 on 3 Aug 2017
Hello KSSV,
Thank you for the tip, I tried to interpolate but sadly it just deletes part of my second samples (i.e. if my samples were n=30 and n=35 it will just cut 5 observations from n=35 to n=30).

Sign in to comment.

More Answers (2)

Star Strider
Star Strider on 1 Aug 2017
I would use the Wilcoxon rank sum test for your data. This assumes that they are (1) independent, and (2) identically distributed, but the distribution itself is irrelevant. Use the ranksum function for the test.

Abubakar Mallam Aliyu
Abubakar Mallam Aliyu on 10 Sep 2017
Edited: Abubakar Mallam Aliyu on 10 Sep 2017
The simplest way to solve this problem is by reducing the number of your observations to become equal and is possible through random selection. Follow this link for reference. Watch video 1 and 2. dealing with unequal sample size in paired sampled test 2
  1 Comment
Star Strider
Star Strider on 10 Sep 2017
Wrong!
The simplest correct way to solve the problem is to use an unpaired test. Paired data are always equal-sized because you are testing the results of some intervention on the same group.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!