Error in is.data.frame(x) : 'list' object cannot be coerced to type 'double'
1
0
Entering edit mode
@582b8f2e
Last seen 21 months ago
China

Hi, when I do Cox professional Hazards region, I encountered such problems.

outTab = data.frame()
pFilter=0.05
sigGenes = c("PFS", "status")
for (i in colnames(rt[, 3:ncol(rt)])) {
  if (sd(rt[, i]) < 0.000001) {
    next
  }

  a = rt[, i] <= median(rt[, i])
  diff = survdiff(Surv(PFS, surstatus) ~ a, data = rt)
  pValue = 1 - pchisq(diff$chisq, df = 1)
  fit = survfit(Surv(PFS, status) ~ a, data = rt)

  cox <- coxph(Surv(PFS, status) ~ rt[, i], data = rt)
  coxSummary = summary(cox)
  coxP = coxSummary$coefficients[, "Pr(>|z|)"]
  outTab = rbind(
    outTab,
    cbind(
      id = i,
      KM = pValue,
      B = coxSummary$coefficients[, "coef"],
      SE = coxSummary$coefficients[, "se(coef)"],
      HR = coxSummary$conf.int[, "exp(coef)"],
      HR.95L = coxSummary$conf.int[, "lower .95"],
      HR.95H = coxSummary$conf.int[, "upper .95"],
      pvalue = coxP
    )
  )

  if ((coxP < pFilter) & (pValue < pFilter)) {
    sigGenes = c(sigGenes, i)
  }
}



Error in is.data.frame(x) : 
  'list' object cannot be coerced to type 'double'

How can I solve this problem? Thank you very much. I tried to use unlist (), but I don't know where to put it in the code

coxCoxproportionalhazardsregression • 1.3k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 4 days ago
United States

Your question has nothing to do with Bioconductor packages, which is the focus of this support site. Please try r-help@r-project.org, or stackoverflow.com.

ADD COMMENT

Login before adding your answer.

Traffic: 403 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6