有谁知道为什么这不会运行?我做的是:
source("http://www.bioconductor.org/biocLite.R")
biocLite("survcomp")
library(survival)
library(prodlim)
然后,复制并粘贴本网站所说的消费税。 https://rdrr.io/bioc/survcomp/man/hazard.ratio.html
set.seed(12345)
age <- rnorm(100, 50, 10)
stime <- rexp(100)
(abridgement)
weight <- runif(100, min=0, max=1)
hazard.ratio(x=age, surv.time=stime, surv.event=sevent, weights=weight, strat=strat)
然后,我得到了一个错误:
Error in hazard.ratio(x = age, surv.time = stime, surv.event = sevent, :
could not find function "hazard.ratio"
如果我只是写下并输入:
hazard.ratio
然后,它出现了:
"Error: object 'hazard.ratio' not found"
你知道如何解决这个问题吗?