I’m attempting to estimate the average treatment effect of a baseline treatment on a survival outcome by fitting a doubly robust estimator using the ate()
function in the package riskRegression
. Documentation states that the argument treatment
must be either the name of the treatment variable or, for IPTW, a glm
object from a logistic regression (treatment regressed on covariates). When I do the latter, I get the error:
`Processing
- Prepare influence function: outcome censoring done
- Point estimation:Error: Not a matrix.`
I do not get this error when using the name of the treatment variable instead. Given that I am trying to use a doubly robust estimator, however, I want to use IPTW but I cannot figure out what is causing this error when I specify the glm
object.
Apologies for not having a reproducible example, but here is the relevant code below, which closely follows the package documentation examples for the ate
function. The scenario is for baseline (time-invariant) treatment and covariates with a survival outcome.
m.event <- coxph(Surv(fu_time, event) ~ treatment + race + sex, data=compdat, x=TRUE)
m.censor <- coxph(Surv(fu_time, event==0) ~ treatment + race + sex, data=compdat, x=TRUE)
m.treatment <- glm(treatment~race+sex, data=compdat, family=binomial(link="logit"))
ateRobust <- ate(event = m.event,
censor=m.censor,
treatment=m.treatment,
data=compdat,
times=0)