tmleAb: Targeted maximum liklihood estimation for antibody...

Description Usage Arguments Details Value References See Also Examples

Description

Targeted maximum liklihood estimation (TMLE) for mean antibody measurements or difference in antibody measurements between groups

Usage

1
2
3
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)

Arguments

Y

antibody measurement

X

comparison group (must be binary, 0/1). If X=NULL, then the function returns the mean (rather than the difference between levels of X).

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, id forces observations in the same cluster or for the same individual to be in the same validation fold.

family

Outcome family, choose gaussian for continuous outcomes and binomial for binary outcomes (default family="gaussian")

SL.library

Library of models/algorithms to include in the ensemble for the outcome (see the SuperLearner package for details).

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 V=5).

RFnodesize

Optional argument to specify a range of minimum node sizes for the random Forest algorithm. If SL.library includes SL.randomForest, then the default is to search over node sizes of 15,20,...40. Specifying this option will override the default.

gamdf

Optional argument to specify a range of degrees of freedom for natural smoothing splines in a generalized additive model. If SL.library includes SL.gam, then the default is to search over a range of df=2-10. Specifying this option will override the default.

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.

Value

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).

References

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.

See Also

agecurveAb, SuperLearner, tmle

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
## 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)

## End(Not run)

ben-arnold/tmleAb documentation built on May 12, 2019, 10:55 a.m.