dimanche 13 octobre 2019

How to overcome t.test error in R as numeric already tried?

I have been performing a t.test on a set of dataframe which looks the following: enter image description here

crime_pc %>%
  filter(year==2016) %>%
  t.test(crime_pc$robbery_pc, alternative = "two.sided", mu = 110)

However, I ran into error:

Error in if (stderr < 10 * .Machine$double.eps * max(abs(mx), abs(my))) stop("data are essentially constant") : 
  missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In mean.default(x) : argument is not numeric or logical: returning NA
2: In var(x) : NAs introduced by coercion

Aucun commentaire:

Enregistrer un commentaire