Entering edit mode
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