2

I am trying to run a pairwise T-test:

Dataundershootwithoutmeansminusstopdistance %>% 
  (Undershootextent ~ Condition, paired = TRUE, p.adjust.method = "bonferroni")

I am getting this result:

Error in complete.cases(x, y) : not all arguments have the same length

However, I don't see why this should be the case:

Here is a subset of my data:

Dataundershootwithoutmeansminusstopdistance
Targetdistance Condition ID Undershootextent
1 63.207  0   P_200214103155  3.498000
2 63.207  0.5 P_200214103155  6.161250
3 63.207  2   P_200214103155 10.420333
4 94.810  0   P_200214103155 15.852250
5 94.810  0.5 P_200214103155 10.553000
6 94.810  2   P_200214103155 10.441000
7 142.215 0   P_200214103155 17.495000
8 142.215 0.5 P_200214103155 38.332667
9 142.215 2   P_200214103155 40.320750
Phil
  • 7,287
  • 3
  • 36
  • 66
Caledonian26
  • 727
  • 1
  • 10
  • 27
  • While your subset of data has an equal number data points per argument your full data set might not. I would recommend writing a test to make sure your full data set has the same number of data points for each argument. – Kyle Swanson Mar 01 '20 at 14:52

1 Answers1

1

Paired is not the same as pairwise.

Pairwise just means that each group shoud be compared with every other group.

When you set paired=TRUE then each pair of conditions will be compared with a paired t-test which will clearly need the number of observations in each condition to have the same length so that the individual observations can be paired up. Are you sure you want paired=TRUE?

George Savva
  • 4,152
  • 1
  • 7
  • 21