Learn R Programming

MAICtools (version 0.1.1)

unanchored_kmplot: Generate a Kaplan-Meier Plot with Individual Efficacy Data and Pseudo Efficacy Data.

Description

Generate a Kaplan-Meier Plot with Individual Efficacy Data and Pseudo Efficacy Data.

Value

A Kaplan-Meier plot object that contains individual efficacy data from the intervention study and pseudo efficacy data from the comparator study.

Arguments

unds_wts

A combined data frame containing individual efficacy data from the intervention study and pseudo efficacy data from the comparator study.

unds.arm

The name of the grouping column in the combined data frame specified by unds_wts, e.g., comparator.arm = TRT. The default is TRT.

unds.param.var

The name of the column that specifies only a subset of the rows of the data to be used.

unds.param

A character specifying the subset of the rows to be used. This is the value of the column set by the unds.param.var.

time

The name of the survival or follow up time column in the combined data frame.

status

The status indicator, normally 0 = event, 1 = censored. Can be reseted using the event parameter.

event

A numeric value that represents the survival status, 0 = event, 1 = censored.

wt.col

The name of the estimated weights column in the data frame specified by unds_wts. The default is wt.

km.xlim

A numeric value specifying the right limit of the scale on the X-axis.

xstepby

An integer guiding the breaks on the X-axis.

km.ylim

A numeric value specifying the upper limit of the scale on the Y-axis.

ystepby

An integer guiding the breaks on the Y-axis.

xlab

A character giving label of the X-axis. The default is "Time (Months)".

ylab

A character giving label of the Y-axis. The default is "Survival probability".

km.legend

A character vector of length >=1 to appear in the legend.

km.title

A character used to set the main title at the top.

...

Refer to ggsurvplot for additional parameters..

Examples

Run this code
# \donttest{
unanchored_kmplot(
  unds_wts = unpts, unds.arm = ARM,
  unds.param.var = PARAMCD, unds.param = "OS",
  time = AVAL, status = CNSR, event = 0,
  wt.col = wt, km.xlim = 35, xstepby = 3,
  km.legend = c("Arm A", "ARM B"),
  km.title = "AAAA")
# }

Run the code above in your browser using DataLab