iPSEsv: General approach of causal mediation analysis for survival...

Description Usage Arguments Value Author(s) Examples

View source: R/sPSE.R

Description

The main function of iPSEsv.

Usage

1
2
3
iPSEsv(data, exposure, base.conf, time.conf, mediators, DAGs,
  suv.model = "Aalen", med.model = "null", time.conf.model = "null",
  a1 = 1, a0 = 0)

Arguments

data

A data frame, where the column is the variable and row is the sample.

exposure

The name of exposure.

base.conf

The names of baseline confounders.

time.conf

The names of time-varying confounders.

mediators

The name of mediators.

DAGs

The ordered variable names in the DAG.

suv.model

The survival model "Aalen" and "Cox". Default is "Aalen".

Value

A list of iPSEsv and partPSEsv

Author(s)

An-Shun Tai daansh13@gmail.com, Pei-Hsuan Lin a52012232@gmail.com, and Sheng-Hsuan Lin shenglin@nctu.edu.tw

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data <- data.frame(time=c(4,3,1,1,2,2,3,3,5,10,2,5,1,7),
status=c(1,1,1,0,1,1,0,1,1,1,0,1,1,0),
x1=rnorm(14,0,1),
x2=rnorm(14,0,1),
x3=rnorm(14,0,1),
c1=rnorm(14,0,1),
c2=rnorm(14,0,1),
c3=rnorm(14,0,1),
sex=c(0,0,1,0,1,1,1,1,1,0,0,0,0,1),
age=c(10,4,2,19,22,31,18,21,41,22,31,29,11,32),
E=sample(c(0,1),size = 14,replace = T))

base.conf <- c("sex","age")
time.conf <- c("c1","c2","c3")
mediators <- c("x1","x2","x3")
DAGs <- c("c1","x1","c2","x2","c3","x3")
exposure <- "E"

output <- iPSEsv(data=data,exposure=exposure,base.conf=base.conf,time.conf=time.conf,
                mediators=mediators,DAGs=DAGs,suv.model="Aalen")

AshTai/iPSEsv documentation built on Oct. 30, 2019, 5:01 a.m.