Does anyone know why this does not run? What I did was:
source("http://www.bioconductor.org/biocLite.R")
biocLite("survcomp")
library(survival)
library(prodlim)
and then, copy and paste of what this website says for my excise. 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)
Then, I got an error like:
Error in hazard.ratio(x = age, surv.time = stime, surv.event = sevent, :
could not find function "hazard.ratio"
If I simply wrote and enter like:
hazard.ratio
Then, it appears:
"Error: object 'hazard.ratio' not found"
Do you know how to fix this problem?