两个样本t test/txt文件数据集的错误消息
在我的数据集上使用 t.test() 后,我收到一条错误消息。数据集是一个txt文件,t.test函数在其他类型的数据集(如dat和csv)上运行良好
这是我的代码:
petro <- read.table(file.choose(), header = TRUE, sep = "\t")
head(petro)
# two independent sample t test
t.test(petro$Canberra, petro$Perth, var.equal = TRUE)
运行t.test函数后,错误消息如下:
*Error in if (stderr < 10 * .Machine$double.eps * abs(mx)) 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*
< a href="https://i.sstatic.net/YqsgY.png" rel="nofollow noreferrer">
I got an error message after I used t.test() on my datasets. The dataset is a txt file, the t.test function works well on other types of datasets like dat and csv
Here's my code:
petro <- read.table(file.choose(), header = TRUE, sep = "\t")
head(petro)
# two independent sample t test
t.test(petro$Canberra, petro$Perth, var.equal = TRUE)
After I run the t.test function, the error message was like:
*Error in if (stderr < 10 * .Machine$double.eps * abs(mx)) 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*
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论