t检验错误 [英] Error with t-test

查看:241
本文介绍了t检验错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的正常t检验有误:

  data <- read.table("/Users/vdas/Documents/RNA-Seq_Smaples_Udine_08032013/GBM_29052013/UD_RP_25072013/filteredFPKM_matrix.txt",sep="",header=TRUE,stringsAsFactors=FALSE)

  PGT <- cbind(data[,2],data[,7],data[,24])
  PDGT <- cbind(data[,6],data[,8])
  pval2 <- NULL
  for(i in 1:length(PGT[,1])){
     pval2 <- c(pval2,t.test(as.numeric(PDGT[i,]),as.numeric(PGT[i,]))$p.value)
     print(i)
  }

错误:

Error in t.test.default(as.numeric(PDGT[i, ]), as.numeric(PGT[i, ])) : 
  not enough 'x' observations

我无法理解向量出了什么问题.你能告诉我吗?我还没弄清楚.

I cannot understand what went wrong with the vector. Can you please tell me? I have not been able to figure it out .

推荐答案

您的数据很可能具有NA值.例如:-

Most likely your data have NA values. For example: -

x<-rep(NA,4)
t.test(x)

Error in t.test.default(x) : not enough 'x' observations

这篇关于t检验错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆