Error "Paired t-test requires equal number of observations in both groups" when performing a paired t-test

Issue

An error message saying “Paired t-test requires equal number of observations in both groups” appears, and the t-test cannot be executed.

Cause

This error occurs when the “Paired” option is set to TRUE for a t-test, but the number of observations (rows) in each group is not the same.

Solution

Please adjust your data so that both groups have the same number of observations before running the test again.
If you prefer not to modify your data, consider setting the “Paired” option to FALSE to run an unpaired (independent) t-test instead.