Hazard ratio using stpm2 package in R

18 views Asked by At

I am trying to plot hazard ratio plot for 1/0 type of medicine for the following data. My data looks like following.

cancer

time event typeofmed 12 1 1 15 0 1 13 1 0 11 1 0

I am not sure what goes in tvc.

fpmh <- stpm2(Surv(time,event) ~ typeofmed,
        data=cancer, tvc=list(?????),
        df=4)
summary(fpmh)

med <- levels(cancer$typeofmed)
newdata1 <- data.frame(typeofmed=med[1])
plot(fpmh, newdata=newdata1, xlab="Time since diagnosis (years)", 
     type="haz")
plot(fpmh, newdata=newdata1, xlab="Time since diagnosis (years)",
 type="hr",var="typeofmed", ci=FALSE, ylim=c(0,6))
0

There are 0 answers