library(dplyr)
library(ggplot2)
devtools::load_all()
load("../simulation/simu_qte_v4.Rdata")
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.width=14,
  fig.height=14
)

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.

We calculate the true value for different xi from 0.35 to 0.95.

est0 %>% knitr::kable(digits = 2)

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

For the IPW part, we considered two types:

$$\sum { I(Y < q) - \tilde{F}_a(y \mid X)) } / e(X_i; \alpha)$$

Missing data and censoring proportion

meta %>% select(a, n, starts_with("pct")) %>% unique()

Simulation Results

Results with observing censoring

All proposed methods performs well under true value. Here we display the results when xi = 0.5.

est1 %>% ungroup() %>% subset(xi == 0.5 & km_rho == "rho_km") %>%
  mutate_if(is.numeric, round, 3)  %>% show_db()

For the results with different xi, we summarize the results in figures below

s1

Robustness of the estimator

Case 1: incorrect outcome regression

We consider a situation when the outcome regression is not correct.

The outcome data $Y$ is simulated from y <- rnorm(n, 0.4 + 0.8 * a + 0.3 * x + x * x2, sd = 1), where $X_2 \sim \mathcal{N}(0, 1)$. Everything else are the same.

s4

Case 2: incorrect propensity score

We consider a situation when the propensity score model is not correct.

The treatment group is simulated from prob <- inv_logit(-0.25 + 0.5 * x + x * x2), where $X_2 \sim \mathcal{N}(0, 1)$. Everything else are the same.

s3


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