Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 两对t检验p值=NA和t=NaN_R_P Value - Fatal编程技术网

R 两对t检验p值=NA和t=NaN

R 两对t检验p值=NA和t=NaN,r,p-value,R,P Value,我想做以下配对t检验: str1<-' ENSEMBLE 0.934 0.934 0.934 0.934 ' str2<-' J48 0.934 0.934 0.934 0.934 ' df1 <- read.table(text=scan(text=str1, what='', quiet=TRUE), header=TRUE) df2 <- read.table(text=scan(text=str2, what='', quiet=TRUE), hea

我想做以下配对t检验:

str1<-' ENSEMBLE 0.934 0.934 0.934 0.934 '
  str2<-' J48 0.934 0.934 0.934 0.934 '

  df1 <- read.table(text=scan(text=str1, what='', quiet=TRUE), header=TRUE)
  df2 <- read.table(text=scan(text=str2, what='', quiet=TRUE), header=TRUE)

t.test ( df1$ENSEMBLE, df2$J48, mu=0 , alt="two.sided", paired = T, conf.level = 0.95)

为什么我会得到它?

这是因为数据集完全相同

df2[1,1] <- .935

t.test ( df1$ENSEMBLE, df2$J48, mu=0 , alt="two.sided", paired = T, conf.level = 0.95)

Paired t-test

data:  df1$ENSEMBLE and df2$J48
t = -1, df = 3, p-value = 0.391
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.0010456116  0.0005456116
sample estimates:
mean of the differences 
           -0.00025 

df2[1,1]您的两个向量完全相同。两组均无差异,因此无标准误差。所以你的答案是不确定的

df2[1,1] <- .935

t.test ( df1$ENSEMBLE, df2$J48, mu=0 , alt="two.sided", paired = T, conf.level = 0.95)

Paired t-test

data:  df1$ENSEMBLE and df2$J48
t = -1, df = 3, p-value = 0.391
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.0010456116  0.0005456116
sample estimates:
mean of the differences 
           -0.00025