View source: R/plotHazSurv.R View source: R/oxy-plotHazSurv.R
plotHazSurv | R Documentation |
Plot the hazard and survival function of the of control group (from weibull or loglogistic distribution) and treatment group (derived from an arbitrary hazard ratio function)
plotHazSurv(
bsl_dist = c("weibull", "loglogistic"),
param = c(1.2, 0.03),
fun_list,
end,
tit = c("Hazard Function", "Survival Function"),
pos = c(1, 2),
hlegend.loc = "bottomleft",
slegend.loc = "topright"
)
bsl_dist |
a text must be one of ( |
param |
a vector of length 2, specifying the shape and rate (1/scale)
parameter of the |
fun_list |
a list of hazard ratio functions comparing treatment group and control group |
end |
a value specifying the duration of the curve |
tit |
a vector specifying the titles of each graph, Default: c("Hazard Function", "Survival Function") |
pos |
a graphic parameter in the form of c(nr,nc). Subsequent figures will be drawn in an nr-by-nc array, Default: c(1, 2) |
hlegend.loc |
a text indicating the position of legend for the hazard plot. Default: "bottomleft" |
slegend.loc |
a text indicating the position of legend for the survival plot. Default: "topright" |
graphics of hazard and survival functions
# proportional hazards
plotHazSurv(
bsl_dist=c("weibull")
,param=c(1.2,1/30)
,fun_list=list(function(x){x^0*0.7})
,40
,tit= c("Hazard Function","Survival Function")
,pos=c(1,2)
)
# crossing hazards
plotHazSurv(
bsl_dist=c("weibull")
,param=c(1.2,1/30)
,fun_list=list(function(x){1.3*(x<10)+(x>=10)*0.7})
,40
,tit= c("Hazard Function","Survival Function")
,pos=c(1,2)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.