TwoSSPiptw: Create an inverse probability of treatment weight adjusted...

View source: R/2SSPipw.R

TwoSSPiptwR Documentation

Create an inverse probability of treatment weight adjusted two-sample survival probability curve for data from observational studies.

Description

This function creates an inverse probability of treatment weight adjusted two-samle survival probability curve for data from observational studies and has options diagnose the proportional hazard assumption.

Usage

TwoSSPiptw(
  time,
  event,
  group,
  weights,
  area = FALSE,
  CI = FALSE,
  level = 0.95,
  B = 1000,
  checkPH = FALSE,
  abtwc = FALSE,
  silent = FALSE,
  xlab = NULL,
  ylab = NULL,
  main = NULL,
  cex.axis = 1.5,
  cex.lab = 1.5,
  legend.inset = 0.02,
  legend.cex = 1.5,
  lty = c(2, 1, 3),
  lwd = 1.5
)

Arguments

time

Time to event or censoring.

event

An indicator vector with values of 1 for individuals who had the event occurred or 0 if the participant was censored.

group

An indicator vector with values of 1 if the the participant was in the exposed group and 0 otherwise.

weights

A vector with weights for each study participant.

area

Logical argument to indicate if user wants an estimate for area under the curve (default is TRUE).

CI

Logical argument indicating if user wants bootstrap errors and confidence intervals to be calculated for the curve and AUC. Default is FALSE.

level

Numerical argument indicating condifence level for the confidence interval. Default is 0.95. It's ignored if CI=FALSE.

B

Number of bootstrap samples to use for confidence interval and error calculations. Default is 1000. It's ignored if CI=FALSE.

checkPH

Logical argument to indicate if user wants to compare the nonparametric curve with the curve based on the proportional hazards model (default is FALSE).

abtwc

Logical argument to indicate if area between curves is needed as part of model comparisons (checkPHM or compare must be TRUE).

silent

Logical argument, FALSE indicates the user wants ROC plots and TRUE indicates no plots only AUC calculations (default is FALSE).

xlab

String argument for the horizontal axis label of the ROC curve.

ylab

String argument for the vertical axis label of the ROC curve.

main

String argument for the title of the ROC curve.

cex.axis

Optional graphical parameter for magnification of axis annotation. See par for more details.

cex.lab

Optional graphical parameter for magnification of x and y labels. See par for more details.

legend.inset

Optional graphical parameter controling the inset of the legend.

legend.cex

Optional graphical parameter for magnification of the legend's text.

lty

Optional graphical parameter to set the type of line to use. Can be a number or a vector. See par for more details.

lwd

Optional graphical parameter for line width relative to the default. See par for more details.

Value

A plot of the ROC curve (if silent=FALSE) and an ROCsurv object containing:

  • A survfit object containing the survival curve for the treatment group.

  • A survfit object containing the survival curve for the control group.

  • The area under the curve (AUC).

  • A matrix representation of the two-sample survival probability curve R_u.


SandraCastroPearson/2SPcurves documentation built on June 15, 2022, 3:42 a.m.