psrwe_survlrk: PS-Integrated Log-Rank Test For Comparing Time-to-event...

View source: R/psrwe_survlrk.R

psrwe_survlrkR Documentation

PS-Integrated Log-Rank Test For Comparing Time-to-event Outcomes

Description

Log-rank test evaluates two-arm RCT for up to a given time point. Variance can be estimated by Jackknife methods. Apply to the case when there is only one external data source and two-arm RCT.

Usage

psrwe_survlrk(
  dta_psbor,
  pred_tp,
  v_time = "time",
  v_event = "event",
  stderr_method = c("naive", "jk", "sjk", "cjk", "sbs", "cbs", "none"),
  n_bootstrap = 200,
  ...
)

Arguments

dta_psbor

A class PSRWE_BOR object generated by psrwe_borrow.

pred_tp

A numeric value corresponding to time of interest (e.g., 365 days or 1 year)

v_time

Column name corresponding to event time

v_event

Column name corresponding to event status

stderr_method

Method for computing StdErr (see Details)

n_bootstrap

Number of bootstrap samples (for bootstrap stderr)

...

Additional Parameters

Details

stderr_method includes naive as default which mostly follows Greenwood formula, jk using Jackknife method within each stratum, sjk using simple Jackknife method for combined estimates such as point estimates in single arm or treatment effects in RCT, or cjk for complex Jackknife method including refitting PS model, matching, trimming, calculating borrowing parameters, and combining overall estimates. Note that sjk may take a while longer to finish and cjk will take even much longer to finish. The sbs and cbs is for simple and complex Bootstrap methods.

Value

A data frame with class name PSRWE_RST_TESTANA. It contains the test statistics of each stratum as well as the Jackknife estimation. The results can be further summarized by its S3 method summary. The results can be also analyzed by psrwe_outana for outcome analysis and inference.

Examples

data(ex_dta_rct)
dta_ps_rct <- psrwe_est(ex_dta_rct,
                        v_covs = paste("V", 1:7, sep = ""),
                        v_grp = "Group", cur_grp_level = "current",
                        v_arm = "Arm", ctl_arm_level = "control",
                        ps_method = "logistic", nstrata = 5,
                        stra_ctl_only = FALSE)
ps_bor_rct <- psrwe_borrow(dta_ps_rct, total_borrow = 30)
rst_lrk <- psrwe_survlrk(ps_bor_rct,
                         pred_tp = 365, 
                         v_time = "Y_Surv",
                         v_event = "Status")
rst_lrk


olssol/psrwe documentation built on July 17, 2024, 4:06 p.m.