0

I've been trying to do some t.test's in R, but something odd is happening. When I run the following:

t.test(mean_rts$rt[mean_rts$task=='simonC' & mean_rts$urg=='high'], mean_rts$rt[mean_rts$task=='simonC' & mean_rts$urg=='low'], paired=TRUE)

I get an error, namely:

Error in t.test.default(mean_rts$rt[mean_rts$task == "simonC" & mean_rts$urg == : not enough 'x' observations

However, I ran t.test before that was the exact same but instead had simonI instead of simonC (including the amount of observations) and that worked perfectly.

Does anyone understand why I am getting this error even though there are the same amount of observations as in a previous t.test that did work?

Also, there are no n.a. values.

zx8754
  • 52,746
  • 12
  • 114
  • 209
  • Welcome to Stack Overflow! Please read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269). This will make it much easier for others to help you. – zx8754 Oct 20 '16 at 10:20
  • So it looks like your filter is filtering to much. What is the result of `subset(mean_rts, task == 'simonC' & urg == 'high')`? I guess you need at least 3 values to calculate a `t.test` – drmariod Oct 20 '16 at 11:53

0 Answers0