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 )
We conducted simulation studies to verify the validity of the proposed IPW and AIPW estimators.
Simulation set up
n = 400
Event indicator: $\delta = T < C$
Missing data: y_obs
in simulated data
y_actual
in simulated data y_actual
= $\min(y) - 1$ if $T < L$ head(db) %>% select(a, x, y, y_obs, y_actual, event_time, censor_time, obs_time, status, analysis_time) %>% knitr::kable(digits = 3)
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)
The calculation is within each treatment group
glm(a ~ x, family = "binomial", data = db)
coxph(Surv(obs_time, 1 - status) ~ x, data = db)
and calculate the probability at the minimal of obs_time
and analysis_time
lm(y_obs ~ x, data = db)
f_q
y_std <- (q - db$y_mean) / db$y_sigma rho + (1 - rho) * pnorm(y_std)
(obs_time > analysis_time) | (obs_time <= analysis_time & status = TRUE)
a
: treatment groupxi
the quantile of interest n
: sample size in each group for true value estimationpct_missing
: Percent of subject with missing value at analysis time $L$pct_missing_death
: Percent of subject dead on or before analysis time $L$pct_missing_censor
: Percent of subject censored on or before analysis time $L$For the IPW part, we considered two types:
$$\sum { I(Y < q) - \tilde{F}_a(y \mid X)) } / e(X_i; \alpha)$$
meta %>% select(a, n, starts_with("pct")) %>% unique()
xi
the quantile of interest use_propensity
: whether to use propensity score is the estimator equation.use_km
: whether to use KM estimator to adjust censoring km_rho
: method to estimate the probability of death at $L$rho
: raw estimator (observed death before $L$) / number of subjectsrho_km
: estimated from Cox model coxph(Surv(obs_time, 1 - status) ~ x, data = db)
at time $L$.rho_km_simple
: estimated from KM estimator at time $L$.type
: using IPW
(formula 5) or AIPW
(formula 6).x0
, x0_true
: estimated or true value for the percentile in control groupx1
, x1_true
: estimated or true value for the percentile in treatment groupdiff
, diff_true
: estimated or true value for the percentile difference between two groupAll 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
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
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.