get_RDs: Evaluate the long format dataset of risk differences over...

Description Usage Arguments Value

View source: R/helper_routines.R

Description

The risk difference (RD) of regimens 1 (dx1) and 2 (dx2) at time-point t is calculated as S_2(t) - S_1(t), where S_2(t) and S_1(t) are the corresponding survival estimates at t for regimens 2 and 1, respectively. The RDs are evaluated for all intersecting time-points in the input data St_data. When the input data contains survival estimates for more than 2 regimens the RDs between all regimens are evaluated in their order of appearance. This order can be controlled with the argument order.

Usage

1
get_RDs(St_data, St_name, getSEs = TRUE, order = seq_along(St_data))

Arguments

St_data

A list containing data.table survival estimates for each regimen to be contrasted.

St_name

The name of the column containing the survival estimates.

getSEs

Should standard errors of risk difference also be estimates? Note that the estimates will only be available when the data.table for each regimen contains a column of subject-specific influence curve (IC) based estimates. The column containing these ICs should be named "IC.St".

order

In which order should the RD contrasts be evaluated? For example, suppose the input data contains the survival estimates for 3 regimens, where dx1, dx2, dx3 denote these three regimens and S_1(t), S_2(t), S_3(t) denote the corresponding survival estimates at time-point t. By default, the following three contrasts will be evaluated in this order: RD(dx1,dx2) = S_2(t)-S_1(t), RD(dx1,dx3)=S_3(t)-S_1(t) and RD(dx2,dx3)=S_3(t)-S_2(t). However, the argument order can be used to change which of the possible three contrasts are evaluated. For example, when setting order=c(3,2,1), the following 3 RDs are evaluated instead: RD(dx3,dx2), RD(dx3,dx1) and RD(dx2,dx1).

Value

A long format dataset (tibble) with risk differences.


osofr/stremr documentation built on Jan. 25, 2022, 8:07 a.m.