jeudi 25 février 2021

What does 'not enough x observations' imply in R?

I'm trying to run a t-test in R Studio and I keep coming back with this error -->

Error in t.test.default(x = subset(mydata$InfMort, subset = mydata$SubSahCountryvariable == : not enough 'x' observations

Here's the code -->

with(mydata, 
  t.test(x = subset(mydata$InfMort, subset = mydata$SubSahCountryvariable == 1), 
         y = subset(mydata$InfMort, subset = mydata$ArabCountryvariable == 1), 
         alternative = "two.sided"))

Anyone have any idea what's going on? I'm a beginner level in R.

Aucun commentaire:

Enregistrer un commentaire