library(dplyr)
devtools::load_all()
load("../simulation/simu_qte_v3.Rdata")
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Simulation Setup

We conducted simulation studies to verify the validity of the proposed IPW and AIPW estimators.

Simulation set up

Example of simulated data

head(db) %>% select(a, x, y, y_obs, y_actual, event_time, censor_time, obs_time, status, analysis_time) %>% 
             knitr::kable(digits = 3)

Method to calculate true value

The true value is estimated by y_actual without using propensity score and censoring adjustment.

The sample size to calculate true value is 10,000 with replication of 1,000 times.

truth_est

Model Estimation

The calculation is within each treatment group

  1. Propensity score: Fit a logistic model: glm(a ~ x, family = "binomial", data = db)
  2. IPW weight $\pi$: Coxph model: coxph(Surv(obs_time, 1 - status) ~ x, data = db) and calculate the probability at the minimal of obs_time and analysis_time
  3. $F(y\mid x; \theta)$
  4. Fit a linear model based on observed outcome lm(y_obs ~ x, data = db)
  5. Calculate the scaled CDF for f_q
y_std <- (q - db$y_mean) / db$y_sigma
rho + (1 - rho) * pnorm(y_std)
  1. $R$: (obs_time > analysis_time) | (obs_time <= analysis_time & status = TRUE)

Simulation Setup

truth_summary %>% select(-q, -diff) %>% knitr::kable(digits = 1)

Simulation Results

Results with observing censoring

res_summary %>% ungroup() %>% 
  subset(censoring) %>% 
  mutate_if(is.numeric, round, 3)  %>% show_db()

Results without observing censoring

res_summary %>% ungroup() %>% 
  subset( (!censoring) & n == 400) %>% 
  mutate_if(is.numeric, round, 3) %>% show_db()


elong0527/qte documentation built on Jan. 19, 2021, 10:24 p.m.