Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 1.1.3.9000 example does not work - missing argument in main survtmle function #57

Open
CraigWangStat opened this issue Sep 23, 2024 · 0 comments

Comments

@CraigWangStat
Copy link

CraigWangStat commented Sep 23, 2024

survtmle version 1.1.3 does not work when the targeted minimum loss-based estimation method is specified as method = mean, due to a missing argument when passing trtOfInterest to its internal function mean_tmle. Below runs through a built-in example from the package.

example("survtmle", package = "survtmle")
## survtmle: Targeted Learning for Survival Analysis
## Version: 1.1.3.9000
## 
## srvtmlR 4.3.1> # simulate data
## srvtmlR 4.3.1> set.seed(1234)
## 
## srvtmlR 4.3.1> n <- 200
## 
## srvtmlR 4.3.1> trt <- rbinom(n, 1, 0.5)
## 
## srvtmlR 4.3.1> adjustVars <- data.frame(W1 = round(runif(n)), W2 = round(runif(n, 0, 2)))
## 
## srvtmlR 4.3.1> ftime <- round(1 + runif(n, 1, 4) - trt + adjustVars$W1 + adjustVars$W2)
## 
## srvtmlR 4.3.1> ftype <- round(runif(n, 0, 1))
## 
## srvtmlR 4.3.1> # Fit 1
## srvtmlR 4.3.1> # fit a survtmle object with glm estimators for treatment, censoring, and
## srvtmlR 4.3.1> # failure using the "mean" method
## srvtmlR 4.3.1> fit1 <- survtmle(
## srvtml+   ftime = ftime, ftype = ftype,
## srvtml+   trt = trt, adjustVars = adjustVars,
## srvtml+   glm.trt = "W1 + W2",
## srvtml+   glm.ftime = "trt + W1 + W2",
## srvtml+   glm.ctime = "trt + W1 + W2",
## srvtml+   method = "mean", t0 = 6
## srvtml+ )

Below is the error message

## Error in estimateCensoring(dataList = dataList, ntrt = ntrt, uniqtrt = uniqtrt, : argument "trtOfInterest" is missing, with no default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant