Targeted maximum liklihood estimation (TMLE) for mean antibody measurements or difference in antibody measurements between groups
tmleAb(Y, X = NULL, W = NULL, id = NULL, family = "gaussian", SL.library = c("SL.mean", "SL.glm", "SL.gam", "SL.loess"), g.SL.library = c("SL.glm"), V = 5, RFnodesize = NULL, gamdf = NULL)
Y | antibody measurement |
---|---|
X | comparison group (must be binary, 0/1). If |
W | matrix of covariates -- should probably at minimum include the individual's age (if available). |
id | An optional cluster or repeated measures id variable. For cross-validation splits, |
family | Outcome family, choose |
SL.library | Library of models/algorithms to include in the ensemble for the outcome (see the |
g.SL.library | Optional library of models/algorithms to model group assignment. Default is to use main terms logistic regression (SL.glm). |
V | Number of cross-validation folds for Super Learning to estimate outcome (Q) and treatment (g) models (default is |
RFnodesize | Optional argument to specify a range of minimum node sizes for the random Forest algorithm. If |
gamdf | Optional argument to specify a range of degrees of freedom for natural smoothing splines in a generalized additive model. If |
psi
Mean (if X=NULL
) or difference
se
Standard error of psi
, estimated from the influence curve
lb
Lower bound of the 95 percent confidence interval of psi
ub
Upper bound of the 95 percent confidence interval of psi
p
P-value for a test that psi=0
tmle_fit
The original tmle()
fit (see the tmle
package for details).
The tmleAb
function estimates adjusted means or differences in means in antibody measurements using targeted maximum likelihood estimation (TMLE).
The function assumes a continuous outcome as the default (family="gaussian"
). If you pass a binary outcome to the function with the family="gaussian"
argument it will still estimate seroprevalence, but it will not necessarily bound predictions between 0 and 1. If you specify family="binomial"
then the predictions will be bound between 0 and 1. Note that some estimation routines do not support binary outcomes (e.g., SL.loess
), and you will see an error if you specify a binomial family with them in the library.
Also note that if you specify family="binomial"
for a binary outcome with a comparison group (X=
), then other contrasts are available to you besides the difference in means (the default stored in psi
). Specifically the relative risk (RR) and odds ratio (OR) will be saved in the tmle_fit$estimates
list.
Gruber S, van der Laan M. tmle: An R Package for Targeted Maximum Likelihood Estimation. J Stat Softw. 2012;51: 1–35.
van der Laan MJ, Polley EC, Hubbard AE. Super Learner. Stat Appl Genet Mol Biol. 2007;6: 1544–6115.
agecurveAb
, SuperLearner
, tmle
# NOT RUN { # load the Garki project serology data, subset to round 5 data("garki_sero") garki_sero$village <- factor(garki_sero$village) garki_sero$sex <- factor(garki_sero$sex) garki_sero$tr01 <- ifelse(garki_sero$tr=="Intervention",1,0) d <- subset(garki_sero,serosvy==5) # control and intervention village measurements dc <- subset(d, tr=="Control") di <- subset(d,tr=="Intervention") # estimate means in control and intervention villages # set a seed for perfectly reproducible splits # in the V-fold cross validation set.seed(12345) cmean <-tmleAb(Y=log10(dc$ifatpftitre+1), W=dc[,c("ageyrs","sex","village")], id=dc$id) set.seed(12345) imean <-tmleAb(Y=log10(di$ifatpftitre+1), W=di[,c("ageyrs","sex","village")], id=di$id) # estimate targeted difference in means # bewteen control and intervention villages # adjusted for age, sex and village set.seed(12345) psi_diff <-tmleAb(Y=log10(d$ifatpftitre+1), X=d$tr01, W=d[,c("ageyrs","sex","village")], id=d$id) # }