Skip to content

Commit 352fdb7

Browse files
Willem M. van der Walcran-robot
authored andcommitted
version 1.2
1 parent 0c0f1b2 commit 352fdb7

File tree

13 files changed

+120
-115
lines changed

13 files changed

+120
-115
lines changed

DESCRIPTION

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
Package: ipw
2-
Version: 1.0-11
3-
Date: 2015-08-18
2+
Version: 1.2
3+
Date: 2023-01-02
44
Title: Estimate Inverse Probability Weights
5-
Authors@R: c(person(c("Ronald", "B."), "Geskus", role=c("aut", "cre"),
6-
, email="r.b.geskus@amc.uva.nl"),
7-
person(c("Willem","M."), "van der Wal", role=c("aut"),
8-
comment="maintainer until 2010"))
9-
Author: Ronald B. Geskus [aut, cre],
10-
Willem M. van der Wal [aut] (maintainer until 2010)
11-
Maintainer: Ronald B. Geskus <r.b.geskus@amc.uva.nl>
5+
Authors@R: c(person(c("Willem", "M."), "van der Wal", role = c("aut", "cre"), email = "willem@vanderwalresearch.com"),
6+
person(c("Ronald", "B."), "Geskus", role=c("aut"), email = "rgeskus@oucru.org", comment = "maintainer 2011-2022"))
7+
Author: Willem M. van der Wal [aut, cre],
8+
Ronald B. Geskus [aut] (maintainer 2011-2022)
9+
Maintainer: Willem M. van der Wal <willem@vanderwalresearch.com>
1210
Depends: R (>= 3.0.0)
1311
Imports: MASS, nnet, survival, geepack, graphics, methods, stats
1412
Suggests: nlme, survey, boot
@@ -19,8 +17,7 @@ Description: Functions to estimate the probability to receive the observed treat
1917
correct for informative censoring.
2018
Encoding: latin1
2119
License: GPL (>= 2)
22-
LazyData: true
2320
NeedsCompilation: no
24-
Packaged: 2015-08-18 13:57:44 UTC; rbgeskus
21+
Packaged: 2023-01-03 07:48:07 UTC; wmvdw
2522
Repository: CRAN
26-
Date/Publication: 2015-08-18 16:58:46
23+
Date/Publication: 2023-01-07 01:10:05 UTC

MD5

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
4f8f69b99d106cbb70d8562f11729c16 *DESCRIPTION
1+
b73e62519f086868a5e0a4266bed8165 *DESCRIPTION
22
2e22845f0b612dc7255c082909b3e485 *NAMESPACE
33
f4ca3ddda31e0c2c3a296e76b40a2a92 *R/ipwplot.R
44
a750e654e8061a1a0b515d3d05a96111 *R/ipwpoint.R
5-
df950ace2eb4c66af4cc834f0a2beb96 *R/ipwtm.R
5+
64a5b4534dce4f84588b819251957ee1 *R/ipwtm.R
66
cdc21f06c11d712cda2b6077c5ab6ae8 *R/tstartfun.R
7+
afbe4209b3bb961ba3e41cbfe79ea507 *build/partial.rdb
78
b53b8bbc825489376bb5b13f8ebd936c *data/basdat.rda
89
a62c2f7cfa3a4f39a87ba53af0b20328 *data/haartdat.rda
910
8ad4e902a3357de9ccc85901ce07d8c3 *data/healthdat.rda
1011
dd95e2bc0dc75d42abfe8136dbda29fa *data/timedat.rda
11-
f978f366db74f1b517f427146d66c5d4 *inst/CITATION
12-
4e441772cc14aff5f0fc711b903a49a3 *man/basdat.Rd
13-
11ef2ab9d55369eb08e5762747c40df2 *man/haartdat.Rd
14-
1697ed76b00a2b8fa9ec17c69c7a05bf *man/healthdat.Rd
15-
1a27742d4f6d867b4c85c67f941bf2a9 *man/ipwplot.Rd
16-
27ce412e89030c0af2cf60e25395b047 *man/ipwpoint.Rd
17-
1a34142725ebe9034d51deb2006a0d9c *man/ipwtm.Rd
18-
d98aafc8fce48f43a1cd2d6dd7f2fe52 *man/timedat.Rd
19-
fef4fbfb35b11ed1dbb3549c515bd74b *man/tstartfun.Rd
12+
205d49c52455860e14af67ac6705ce60 *inst/CITATION
13+
548818cb0fda0b5f56cf6bee87cdd3ba *man/basdat.Rd
14+
8bfdce30774155d8a4bafd1d22bef6ed *man/haartdat.Rd
15+
18bdde99298a10d37e762d8c3734a986 *man/healthdat.Rd
16+
8f1793dc2bcc463439e8d538d7e4daa3 *man/ipwplot.Rd
17+
df5a62081b0ad79d4f30ee6e4afdbb71 *man/ipwpoint.Rd
18+
304f7fc8cddd6c8d4db705e1c2695c97 *man/ipwtm.Rd
19+
db3a0eb785e56e5187bb9a1853c22411 *man/timedat.Rd
20+
040eb5c7623824777182663c50184f6f *man/tstartfun.Rd

R/ipwtm.R

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@ ipwtm <- function(
1919
if (!("exposure" %in% names(tempcall))) stop("No exposure variable specified")
2020
if (!("family" %in% names(tempcall)) | ("family" %in% names(tempcall) & !(tempcall$family %in% c("binomial", "survival", "multinomial", "ordinal", "gaussian")))) stop("No valid family specified (\"binomial\", \"survival\", \"multinomial\", \"ordinal\", \"gaussian\")")
2121
if (tempcall$family == "binomial") {if(!(tempcall$link %in% c("logit", "probit", "cauchit", "log", "cloglog"))) stop("No valid link function specified for family = binomial (\"logit\", \"probit\", \"cauchit\", \"log\", \"cloglog\")")}
22-
if (tempcall$family == "ordinal" ) {if(!(tempcall$link %in% c("logit", "probit", "cauchit", "cloglog"))) stop("No valid link function specified for family = binomial (\"logit\", \"probit\", \"cauchit\", \"cloglog\")")}
22+
if (tempcall$family == "ordinal" ) {if(!(tempcall$link %in% c("logit", "probit", "cauchit", "cloglog"))) stop("No valid link function specified for family = ordinal (\"logit\", \"probit\", \"cauchit\", \"cloglog\")")}
2323
if (!("denominator" %in% names(tempcall))) stop("No denominator model specified")
2424
if (!is.null(tempcall$numerator) & !is(eval(tempcall$numerator), "formula")) stop("Invalid numerator formula specified")
2525
if (!is.null(tempcall$denominator) & !is(eval(tempcall$denominator), "formula")) stop("Invalid denominator formula specified")
2626
if (!("id" %in% names(tempcall))) stop("No patient id specified")
2727
if (tempcall$family == "survival" & !("tstart" %in% names(tempcall))) stop("No tstart specified, is necessary for family = \"survival\"")
2828
if (!("timevar" %in% names(tempcall))) stop("No timevar specified")
2929
if (!("type" %in% names(tempcall))) stop("No type specified (\"first\" or \"all\")")
30-
if (!(tempcall$type %in% c("first", "all"))) stop("No type specified (\"first\" or \"all\")")
30+
if (!(tempcall$type %in% c("first", "all", "cens"))) stop("No type specified (\"first\", \"all\" or \"cens\")")
3131
if (tempcall$family %in% c("survival", "multinomial", "ordinal") & tempcall$type == "all") stop(paste("Type \"all\" not yet implemented for family = ", deparse(tempcall$family, width.cutoff = 500), sep = ""))
32+
if (tempcall$family %in% c("multinomial", "ordinal", "gaussian") & tempcall$type == "cens") stop(paste("Type \"cens\" not yet implemented for family = ", deparse(tempcall$family, width.cutoff = 500), sep = ""))
3233
if (tempcall$family %in% c("gaussian") & tempcall$type == "first") stop(paste("Type \"first\" not implemented for family = ", deparse(tempcall$family, width.cutoff = 500), sep = ""))
3334
if (tempcall$family %in% c("gaussian") & !("numerator" %in% names(tempcall))) stop("Numerator necessary for family = \"gaussian\"")
3435
if (!("data" %in% names(tempcall))) stop("No data specified")
@@ -51,17 +52,17 @@ ipwtm <- function(
5152
exposure = data[,as.character(tempcall$exposure)]
5253
)
5354
#make selection variable, time points up to first switch from lowest value, or all time points
54-
if (type == "first" & (family == "binomial" | family == "survival"))
55+
if (type %in% c("first", "cens") & (family == "binomial" | family == "survival"))
5556
{tempdat$selvar <- do.call("c", lapply(split(tempdat$exposure, tempdat$id),function(x)if (!is.na(match(1, x))) return(c(rep(1,match(1, x)),rep(0,length(x)-match(1, x)))) else return(rep(1,length(x)))))}
56-
if (type == "first" & (family == "multinomial" | family == "ordinal")){
57+
if (type %in% c("first", "cens") & (family == "multinomial" | family == "ordinal")){
5758
z <- unique(tempdat$exposure)[unique(tempdat$exposure) != sort(unique(tempdat$exposure))[1]]
5859
min2 <- function(x)ifelse(min(is.na(unique(x))) == 1, NA, min(x, na.rm = TRUE))
5960
tempdat$selvar <- do.call("c", lapply(split(tempdat$exposure, tempdat$id),function(x)if (!is.na(min2(match(z, x)))) return(c(rep(1,min2(match(z, x))),rep(0,length(x)-min2(match(z, x))))) else return(rep(1,length(x)))))
6061
}
6162
if (type == "all")
6263
{tempdat$selvar <- rep(1, nrow(tempdat))}
6364
#weights binomial, type "first"
64-
if (tempcall$family == "binomial" & tempcall$type == "first") {
65+
if (tempcall$family == "binomial" & tempcall$type %in% c("first", "cens")) {
6566
if(tempcall$link == "logit") lf <- binomial(link = logit)
6667
if(tempcall$link == "probit") lf <- binomial(link = probit)
6768
if(tempcall$link == "cauchit") lf <- binomial(link = cauchit)
@@ -78,7 +79,8 @@ ipwtm <- function(
7879
...)
7980
tempdat$p.numerator <- vector("numeric", nrow(tempdat))
8081
tempdat$p.numerator[tempdat$exposure == 0 & tempdat$selvar == 1] <- 1 - predict.glm(mod1, type = "response")[tempdat$exposure[tempdat$selvar == 1] == 0]
81-
tempdat$p.numerator[tempdat$exposure == 1 & tempdat$selvar == 1] <- predict.glm(mod1, type = "response")[tempdat$exposure[tempdat$selvar == 1] == 1]
82+
if(type == "first"){tempdat$p.numerator[tempdat$exposure == 1 & tempdat$selvar == 1] <- predict.glm(mod1, type = "response")[tempdat$exposure[tempdat$selvar == 1] == 1]}
83+
if(type == "cens"){tempdat$p.numerator[tempdat$exposure == 1 & tempdat$selvar == 1] <- 1 - predict.glm(mod1, type = "response")[tempdat$exposure[tempdat$selvar == 1] == 1]}
8284
tempdat$p.numerator[tempdat$selvar == 0] <- 1
8385
tempdat$w.numerator <- unlist(lapply(split(tempdat$p.numerator, tempdat$id), function(x)cumprod(x)))
8486
mod1$call$formula <- eval(parse(text = paste(deparse(tempcall$exposure, width.cutoff = 500), deparse(tempcall$numerator, width.cutoff = 500), sep = "")))
@@ -95,7 +97,8 @@ ipwtm <- function(
9597
...)
9698
tempdat$p.denominator <- vector("numeric", nrow(tempdat))
9799
tempdat$p.denominator[tempdat$exposure == 0 & tempdat$selvar == 1] <- 1 - predict.glm(mod2, type = "response")[tempdat$exposure[tempdat$selvar == 1] == 0]
98-
tempdat$p.denominator[tempdat$exposure == 1 & tempdat$selvar == 1] <- predict.glm(mod2, type = "response")[tempdat$exposure[tempdat$selvar == 1] == 1]
100+
if(type == "first"){tempdat$p.denominator[tempdat$exposure == 1 & tempdat$selvar == 1] <- predict.glm(mod2, type = "response")[tempdat$exposure[tempdat$selvar == 1] == 1]}
101+
if(type == "cens"){tempdat$p.denominator[tempdat$exposure == 1 & tempdat$selvar == 1] <- 1 - predict.glm(mod2, type = "response")[tempdat$exposure[tempdat$selvar == 1] == 1]}
99102
tempdat$p.denominator[tempdat$selvar == 0] <- 1
100103
tempdat$w.denominator <- unlist(lapply(split(tempdat$p.denominator, tempdat$id), function(x)cumprod(x)))
101104
mod2$call$formula <- eval(parse(text = paste(deparse(tempcall$exposure, width.cutoff = 500), deparse(tempcall$denominator, width.cutoff = 500), sep = "")))
@@ -163,12 +166,13 @@ ipwtm <- function(
163166
temp$bashaz.cum.numerator <- NULL
164167
tempdat <- merge(tempdat, temp, by = "timevar", all.x = TRUE);rm(temp)
165168
tempdat <- tempdat[order(tempdat$id, tempdat$timevar),]
166-
tempdat$risk.numerator[tempdat$selvar == 1] <- predict(mod1, type="risk", centered = TRUE)
169+
tempdat$risk.numerator[tempdat$selvar == 1] <-predict(mod1, type="risk", centered = TRUE)
167170
tempdat$hazard.numerator[tempdat$selvar == 1] <- with(tempdat[tempdat$selvar == 1,], bashaz.numerator*risk.numerator)
168171
tempdat$p.numerator[with(tempdat, selvar == 1 & exposure == 0)] <- with(tempdat[with(tempdat, selvar == 1 & exposure == 0),], exp(-1*bashaz.numerator*risk.numerator))
169-
tempdat$p.numerator[with(tempdat, selvar == 1 & exposure == 1)] <- 1 - with(tempdat[with(tempdat, selvar == 1 & exposure == 1),], exp(-1*bashaz.numerator*risk.numerator))
172+
if(type == "first"){tempdat$p.numerator[with(tempdat, selvar == 1 & exposure == 1)] <- 1 - with(tempdat[with(tempdat, selvar == 1 & exposure == 1),], exp(-1*bashaz.numerator*risk.numerator))}
173+
if(type == "cens"){tempdat$p.numerator[with(tempdat, selvar == 1 & exposure == 1)] <- with(tempdat[with(tempdat, selvar == 1 & exposure == 1),], exp(-1*bashaz.numerator*risk.numerator))}
170174
tempdat$p.numerator[tempdat$selvar == 0] <- 1
171-
tempdat$w.numerator <- unsplit(lapply(split(tempdat$p.numerator, tempdat$id), function(x) cumprod(x)), tempdat$id)
175+
tempdat$w.numerator <- unsplit(lapply(split(tempdat$p.numerator, tempdat$id), function(x)cumprod(x)), tempdat$id)
172176
mod1$call$formula <- eval(parse(text = paste("Surv(", deparse(tempcall$tstart), ", ", deparse(tempcall$timevar, width.cutoff = 500), ", ", deparse(tempcall$exposure, width.cutoff = 500), ") ", deparse(tempcall$numerator, width.cutoff = 500), sep = "")))
173177
mod1$call$data <- tempcall$data
174178
}
@@ -189,10 +193,11 @@ ipwtm <- function(
189193
temp$bashaz.cum.denominator <- NULL
190194
tempdat <- merge(tempdat, temp, by = "timevar", all.x = TRUE);rm(temp)
191195
tempdat <- tempdat[order(tempdat$id, tempdat$timevar),]
192-
tempdat$risk.denominator[tempdat$selvar == 1] <- predict(mod2, type="risk", centered = TRUE)
196+
tempdat$risk.denominator[tempdat$selvar == 1] <-predict(mod2, type="risk", centered = TRUE)
193197
tempdat$hazard.denominator[tempdat$selvar == 1] <- with(tempdat[tempdat$selvar == 1,], bashaz.denominator*risk.denominator)
194198
tempdat$p.denominator[with(tempdat, selvar == 1 & exposure == 0)] <- with(tempdat[with(tempdat, selvar == 1 & exposure == 0),], exp(-1*bashaz.denominator*risk.denominator))
195-
tempdat$p.denominator[with(tempdat, selvar == 1 & exposure == 1)] <- 1 - with(tempdat[with(tempdat, selvar == 1 & exposure == 1),], exp(-1*bashaz.denominator*risk.denominator))
199+
if(type == "first"){tempdat$p.denominator[with(tempdat, selvar == 1 & exposure == 1)] <- 1 - with(tempdat[with(tempdat, selvar == 1 & exposure == 1),], exp(-1*bashaz.denominator*risk.denominator))}
200+
if(type == "cens"){tempdat$p.denominator[with(tempdat, selvar == 1 & exposure == 1)] <- with(tempdat[with(tempdat, selvar == 1 & exposure == 1),], exp(-1*bashaz.denominator*risk.denominator))}
196201
tempdat$p.denominator[tempdat$selvar == 0] <- 1
197202
tempdat$w.denominator <- unsplit(lapply(split(tempdat$p.denominator, tempdat$id), function(x)cumprod(x)), tempdat$id)
198203
mod2$call$formula <- eval(parse(text = paste("Surv(", deparse(tempcall$tstart), ", ", deparse(tempcall$timevar, width.cutoff = 500), ", ", deparse(tempcall$exposure, width.cutoff = 500), ") ", deparse(tempcall$denominator, width.cutoff = 500), sep = "")))

build/partial.rdb

61 Bytes
Binary file not shown.

inst/CITATION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ citEntry(entry = "Article",
99
volume = "43",
1010
number = "13",
1111
pages = "1--23",
12-
url = "http://www.jstatsoft.org/v43/i13/",
12+
doi = "10.18637/jss.v043.i13",
1313

1414
textVersion =
1515
paste("Willem M. van der Wal, Ronald B. Geskus (2011).",
1616
"ipw: An R Package for Inverse Probability Weighting.",
1717
"Journal of Statistical Software, 43(13), 1-23.",
18-
"URL http://www.jstatsoft.org/v43/i13/.")
18+
"DOI 10.18637/jss.v043.i13")
1919
)
2020

man/basdat.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ These simulated data are used together with data in \code{\link{timedat}} in a d
2222
}
2323

2424
\references{
25-
Van der Wal W.M. & Geskus R.B. (2011). ipw: An R Package for Inverse Probability Weighting. \emph{Journal of Statistical Software}, \bold{43}(13), 1-23. \url{http://www.jstatsoft.org/v43/i13/}.
25+
Van der Wal W.M. & Geskus R.B. (2011). ipw: An R Package for Inverse Probability Weighting. \emph{Journal of Statistical Software}, \bold{43}(13), 1-23. \doi{10.18637/jss.v043.i13}.
2626

2727
Van der Wal W.M., Prins M., Lumbreras B. & Geskus R.B. (2009). A simple G-computation algorithm to quantify the causal effect of a secondary illness on the progression of a chronic disease. \emph{Statistics in Medicine}, \bold{28}(18), 2325-2337.
2828
}
2929

30-
\author{Willem M. van der Wal \email{w.m.vanderwal@amc.uva.nl}}
30+
\author{Willem M. van der Wal \email{willem@vanderwalresearch.com}, Ronald B. Geskus \email{rgeskus@oucru.org}}
3131

3232
\seealso{\code{\link{basdat}}, \code{\link{haartdat}}, \code{\link{ipwplot}}, \code{\link{ipwpoint}}, \code{\link{ipwtm}}, \code{\link{timedat}}, \code{\link{tstartfun}}.}
3333

man/haartdat.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ Patients can initiate HAART at \code{fuptime=0}. Therefore, to allow the fitting
2828
}
2929

3030
\references{
31-
Van der Wal W.M. & Geskus R.B. (2011). ipw: An R Package for Inverse Probability Weighting. \emph{Journal of Statistical Software}, \bold{43}(13), 1-23. \url{http://www.jstatsoft.org/v43/i13/}.
31+
Van der Wal W.M. & Geskus R.B. (2011). ipw: An R Package for Inverse Probability Weighting. \emph{Journal of Statistical Software}, \bold{43}(13), 1-23. \doi{10.18637/jss.v043.i13}.
3232
}
3333

34-
\author{Willem M. van der Wal \email{w.m.vanderwal@amc.uva.nl}}
34+
\author{Willem M. van der Wal \email{willem@vanderwalresearch.com}, Ronald B. Geskus \email{rgeskus@oucru.org}}
3535

3636
\seealso{\code{\link{basdat}}, \code{\link{haartdat}}, \code{\link{ipwplot}}, \code{\link{ipwpoint}}, \code{\link{ipwtm}}, \code{\link{timedat}}, \code{\link{tstartfun}}.}
3737

man/healthdat.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ In these simulated data, IQ is a confounder for the effect of income on health.
2222
}
2323

2424
\references{
25-
Van der Wal W.M. & Geskus R.B. (2011). ipw: An R Package for Inverse Probability Weighting. \emph{Journal of Statistical Software}, \bold{43}(13), 1-23. \url{http://www.jstatsoft.org/v43/i13/}.
25+
Van der Wal W.M. & Geskus R.B. (2011). ipw: An R Package for Inverse Probability Weighting. \emph{Journal of Statistical Software}, \bold{43}(13), 1-23. \doi{10.18637/jss.v043.i13}.
2626
}
2727

28-
\author{Willem M. van der Wal \email{w.m.vanderwal@amc.uva.nl}}
28+
\author{Willem M. van der Wal \email{willem@vanderwalresearch.com}, Ronald B. Geskus \email{rgeskus@oucru.org}}
2929

3030
\seealso{\code{\link{basdat}}, \code{\link{haartdat}}, \code{\link{healthdat}}, \code{\link{ipwplot}}, \code{\link{ipwpoint}}, \code{\link{ipwtm}}, \code{\link{timedat}}, \code{\link{tstartfun}}.}
3131

man/ipwplot.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ A plot is displayed.
3131
}
3232

3333
\references{
34-
Van der Wal W.M. & Geskus R.B. (2011). ipw: An R Package for Inverse Probability Weighting. \emph{Journal of Statistical Software}, \bold{43}(13), 1-23. \url{http://www.jstatsoft.org/v43/i13/}.
34+
Van der Wal W.M. & Geskus R.B. (2011). ipw: An R Package for Inverse Probability Weighting. \emph{Journal of Statistical Software}, \bold{43}(13), 1-23. \doi{10.18637/jss.v043.i13}.
3535
}
3636

37-
\author{Willem M. van der Wal \email{w.m.vanderwal@amc.uva.nl}}
37+
\author{Willem M. van der Wal \email{willem@vanderwalresearch.com}, Ronald B. Geskus \email{rgeskus@oucru.org}}
3838

3939
\seealso{\code{\link{basdat}}, \code{\link{haartdat}}, \code{\link{ipwplot}}, \code{\link{ipwpoint}}, \code{\link{ipwtm}}, \code{\link{timedat}}, \code{\link{tstartfun}}.}
4040

man/ipwpoint.Rd

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ Cole, S.R. & Hern
4949

5050
Robins, J.M., Hernán, M.A. & Brumback, B.A. (2000). Marginal structural models and causal inference in epidemiology. \emph{Epidemiology}, \bold{11}, 550-560.
5151

52-
Van der Wal W.M. & Geskus R.B. (2011). ipw: An R Package for Inverse Probability Weighting. \emph{Journal of Statistical Software}, \bold{43}(13), 1-23. \url{http://www.jstatsoft.org/v43/i13/}.
52+
Van der Wal W.M. & Geskus R.B. (2011). ipw: An R Package for Inverse Probability Weighting. \emph{Journal of Statistical Software}, \bold{43}(13), 1-23. \doi{10.18637/jss.v043.i13}.
5353
}
5454

55-
\author{Willem M. van der Wal \email{w.m.vanderwal@amc.uva.nl}}
55+
\author{Willem M. van der Wal \email{willem@vanderwalresearch.com}, Ronald B. Geskus \email{rgeskus@oucru.org}}
5656

5757
\seealso{\code{\link{basdat}}, \code{\link{haartdat}}, \code{\link{ipwplot}}, \code{\link{ipwpoint}}, \code{\link{ipwtm}}, \code{\link{timedat}}, \code{\link{tstartfun}}.}
5858

@@ -99,23 +99,24 @@ coef(msm)
9999
confint(msm)
100100

101101

102-
\dontrun{
102+
## Not run:
103103
#Compute basic bootstrap confidence interval .
104-
require(boot)
105-
boot.fun <- function(dat, index){
106-
coef(glm(
107-
formula = y ~ a,
108-
data = dat[index,],
109-
weights = ipwpoint(
110-
exposure = a,
111-
family = "gaussian",
112-
numerator = ~ 1,
113-
denominator = ~ l,
114-
data = dat[index,])$ipw.weights))[2]
115-
}
116-
bootres <- boot(simdat, boot.fun, 499);bootres
117-
boot.ci(bootres, type = "basic")
118-
}
104+
#require(boot)
105+
#boot.fun <- function(dat, index){
106+
# coef(glm(
107+
# formula = y ~ a,
108+
# data = dat[index,],
109+
# weights = ipwpoint(
110+
# exposure = a,
111+
# family = "gaussian",
112+
# numerator = ~ 1,
113+
# denominator = ~ l,
114+
# data = dat[index,])$ipw.weights))[2]
115+
# }
116+
#bootres <- boot(simdat, boot.fun, 499);bootres
117+
#boot.ci(bootres, type = "basic")
118+
119+
## End(Not run)
119120

120121
}
121122

0 commit comments

Comments
 (0)