CASCR: Semiparametric Causal Mediation Modeling of Semi-Competing...

Description Usage Arguments Value

View source: R/load.R

Description

This function analyzes semicompeting risks data and gives the estimators of direct and indirect effects, along with their variances.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
CASCR(
  df,
  effect = c("DE", "IE"),
  intervention = c(1, 0),
  cal_level = "median",
  myunit = "raw",
  downsample = 1,
  sen_ana = FALSE,
  get_variance = c("asymptotic"),
  boot_times = 1000,
  timer = TRUE,
  num_of_cores = 1,
  plot_result = FALSE,
  variance_method = "new",
  threshold = 1e-10
)

Arguments

df

a data frame with designated column order: T1, T2, d1, d2, Z, X where X maybe empty or a matrix.

effect

the causal effect to be estimated. Choices are "DE" or "IE". Default is c("DE", "IE")

intervention

numeric vector with two elements. Default is c(1, 0).

cal_level

the level X should be evaluated at. It can be a numeric vector with length(cal_level) = dim(X)[2] or "median", "mean", etc. Default is "median".

myunit

the length to be considered as one unit. Default is "raw".

downsample

indicates how many consecutive event should be considered as one event. Default is 1.

sen_ana

doing sensitivity analysis or not. Default is FALSE.

get_variance

the method to compute the variance. Choices are "a" or "b". Default is "a".

boot_times

the times of bootstrap. Default is 1000.

timer

will show the progress. Default is TRUE.

num_of_cores

the number of cores assigned. Default is 1.

plot_result

will show some primary result. Default is FALSE.

threshold

specifies if a logistic regression converge or not. Default is 1e-10.

Value

CASCR returns a list with components specified by effect.


eric40065/CausalAnalysisforSemiCompRisks documentation built on Dec. 20, 2021, 5:28 a.m.