0

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?

zx8754
  • 52,746
  • 12
  • 114
  • 209
  • 2
    Maybe you didn't load the library? `library(survcomp)` – zx8754 May 31 '18 at 11:27
  • 1
    That's it! Now I know who is famous. Now I understand correctly why you have such a great reputation. Thank you very much for all you have done for me, question edit and so on. I do appreciate it. – user9690450 Jun 01 '18 at 09:40

0 Answers0