I would like to plot delta of RMST over a time period for two groups. X axis --> Time (year), Y axis --> Delta of RMST(days).
a=rmst2(time, status, arm, tau=10)
> print(a)
Between-group contrast
Est. lower .95 upper .95 p
RMST (arm=1)-(arm=0) -0.137 -0.939 0.665 0.738
RMST (arm=1)/(arm=0) 0.981 0.878 1.096 0.738
RMTL (arm=1)/(arm=0) 1.050 0.787 1.402 0.738
I would like to plot the above data (including confidence intervals) for all points of time. Is there a function in R to do that or can I somehow make an array or list of the following result object and plot it to achieve the same?
a$unadjusted.result
One way is to hack the
survRM2:::plot.rmst2function so that confidence intervals are passed on to theplotfunction. In the current version of the survRM2 package (1.0-4) they are not.To hack the function, type the following at the R prompt:
Copy the code into a new R script file and add the following to the function call:
On lines 35 and 66, insert the following:
Send the function to the R console so that it is available. Then call the function:
Data: