From 466b34cdb9b9fcc404e7a6b859eddf283b8f4760 Mon Sep 17 00:00:00 2001 From: Nick Williams Date: Mon, 13 Jul 2020 16:00:18 -0400 Subject: [PATCH 1/3] cran relase --- CRAN-RELEASE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRAN-RELEASE b/CRAN-RELEASE index de37222..98deb0b 100644 --- a/CRAN-RELEASE +++ b/CRAN-RELEASE @@ -1,2 +1,2 @@ -This package was submitted to CRAN on 2020-07-10. -Once it is accepted, delete this file and tag the release (commit 0a05bebcfe). +This package was submitted to CRAN on 2020-07-13. +Once it is accepted, delete this file and tag the release (commit c397f48bbf). From de37c253da6fbe3ec4a6494b0d8b0579ad653fc1 Mon Sep 17 00:00:00 2001 From: Nick Williams Date: Mon, 13 Jul 2020 16:10:42 -0400 Subject: [PATCH 2/3] fixing outcome regression return bug --- DESCRIPTION | 2 +- R/theta.R | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 17f0f00..c9e5447 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: lmtp Title: Non-Parametric Causal Effects of Feasible Interventions Based on Modified Treatment Policies -Version: 0.0.4 +Version: 0.0.5.9000 Authors@R: c(person(given = "Nicholas", family = "Williams", diff --git a/R/theta.R b/R/theta.R index d5c64ef..ad7707f 100644 --- a/R/theta.R +++ b/R/theta.R @@ -25,7 +25,9 @@ theta_sub <- function(eta) { low = NA_real_, high = NA_real_, shift = eta$shift, - outcome_reg = rescale_y_continuous(eta$m, eta$bounds), + outcome_reg = switch(eta$outcome_type, + continuous = rescale_y_continuous(eta$m, eta$bounds), + binomial = eta$m), weights_m = eta$weights_m, outcome_type = eta$outcome_type) @@ -92,7 +94,9 @@ theta_dr <- function(eta) { high = ci_high, eif = inflnce, shift = eta$shift, - outcome_reg = rescale_y_continuous(eta$m$shifted, eta$bounds), + outcome_reg = switch(eta$outcome_type, + continuous = rescale_y_continuous(eta$m$shifted, eta$bounds), + binomial = eta$m$shifted), density_ratios = eta$r, weights_m = eta$weights_m, weights_r = eta$weights_r, From 7f2c91660336aa0dcc844ded02c770ab1e0cdafb Mon Sep 17 00:00:00 2001 From: Nick Williams Date: Tue, 14 Jul 2020 11:37:24 -0400 Subject: [PATCH 3/3] addressing cran comments --- DESCRIPTION | 4 ++-- R/shift.R | 4 ++-- R/tidy.R | 4 ++-- README.Rmd | 2 +- README.md | 2 +- man/lmtp-package.Rd | 2 +- man/static_binary_off.Rd | 2 +- man/static_binary_on.Rd | 2 +- man/tidy.lmtp.Rd | 4 ++-- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index c9e5447..e1bbef3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: lmtp Title: Non-Parametric Causal Effects of Feasible Interventions Based on Modified Treatment Policies -Version: 0.0.5.9000 +Version: 0.0.5 Authors@R: c(person(given = "Nicholas", family = "Williams", @@ -10,7 +10,7 @@ Authors@R: person(given = "Iván", family = "Díaz", email = "ild2005@med.cornell.edu", - role = c("aut"), + role = c("aut", "cph"), comment = c(ORCID = "0000-0001-9056-2047"))) Description: Non-parametric estimators for casual effects based on longitudinal modified treatment policies as described in Diaz, Williams, and Hoffman (), traditional point treatment, diff --git a/R/shift.R b/R/shift.R index c326218..bf6a20d 100644 --- a/R/shift.R +++ b/R/shift.R @@ -34,7 +34,7 @@ shift_trt <- function(data, trt, .f) { #' @export #' #' @examples -#' \dontrun{ +#' \donttest{ #' data("iptwExWide", package = "twang") #' a <- paste0("tx", 1:3) #' baseline <- c("gender", "age") @@ -59,7 +59,7 @@ static_binary_on <- function(data, trt) { #' @export #' #' @examples -#' \dontrun{ +#' \donttest{ #' data("iptwExWide", package = "twang") #' a <- paste0("tx", 1:3) #' baseline <- c("gender", "age") diff --git a/R/tidy.R b/R/tidy.R index f03985f..4f0ff76 100644 --- a/R/tidy.R +++ b/R/tidy.R @@ -10,12 +10,12 @@ generics::tidy #' @param ... Unused, included for generic consistency only. #' #' @examples -#' \dontrun{ +#' \donttest{ #' a <- c("A1", "A2") #' nodes <- list(c("L1"), c("L2")) #' cens <- c("C1", "C2") #' y <- "Y" -#' fit <- lmtp_tmle(sim_cens, a, y, nodes, cens = cens, shift = NULL, folds = 2) +#' fit <- lmtp_tmle(sim_cens, a, y, time_vary = nodes, cens = cens, shift = NULL, folds = 2) #' tidy(fit) #' } #' diff --git a/README.Rmd b/README.Rmd index 174cf35..4278d61 100644 --- a/README.Rmd +++ b/README.Rmd @@ -130,7 +130,7 @@ Please cite the following when using `lmtp` in publications. Citation should inc title = {lmtp: {Non}-parametric {Causal} {Effects} of {Feasible} {Interventions} {Based} on {Modified} {Treatment} {Policies}}, author = {Nicholas T Williams and Iván Díaz}, year = {2020}, - note = {R package version 0.0.91}, + note = {R package version 0.0.5}, doi = {10.5281/zenodo.3874931}, url = {https://github.com/nt-williams/lmtp} } diff --git a/README.md b/README.md index 88e00af..bc71c51 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ statistical methodology. title = {lmtp: {Non}-parametric {Causal} {Effects} of {Feasible} {Interventions} {Based} on {Modified} {Treatment} {Policies}}, author = {Nicholas T Williams and Iván Díaz}, year = {2020}, - note = {R package version 0.0.91}, + note = {R package version 0.0.5}, doi = {10.5281/zenodo.3874931}, url = {https://github.com/nt-williams/lmtp} } diff --git a/man/lmtp-package.Rd b/man/lmtp-package.Rd index f1db2e0..fc49eca 100644 --- a/man/lmtp-package.Rd +++ b/man/lmtp-package.Rd @@ -19,7 +19,7 @@ Non-parametric estimators for casual effects based on longitudinal modified trea Authors: \itemize{ - \item Iván Díaz \email{ild2005@med.cornell.edu} (\href{https://orcid.org/0000-0001-9056-2047}{ORCID}) + \item Iván Díaz \email{ild2005@med.cornell.edu} (\href{https://orcid.org/0000-0001-9056-2047}{ORCID}) [copyright holder] } } diff --git a/man/static_binary_off.Rd b/man/static_binary_off.Rd index 646d5b5..b6b1998 100644 --- a/man/static_binary_off.Rd +++ b/man/static_binary_off.Rd @@ -19,7 +19,7 @@ A pre-packaged shift function for use with provided estimators when the exposure Used to estimate the population intervention effect when all treatment variables are set to 0. } \examples{ -\dontrun{ +\donttest{ data("iptwExWide", package = "twang") a <- paste0("tx", 1:3) baseline <- c("gender", "age") diff --git a/man/static_binary_on.Rd b/man/static_binary_on.Rd index 19dc472..ee8fb61 100644 --- a/man/static_binary_on.Rd +++ b/man/static_binary_on.Rd @@ -19,7 +19,7 @@ A pre-packaged shift function for use with provided estimators when the exposure Used to estimate the population intervention effect when all treatment variables are set to 1. } \examples{ -\dontrun{ +\donttest{ data("iptwExWide", package = "twang") a <- paste0("tx", 1:3) baseline <- c("gender", "age") diff --git a/man/tidy.lmtp.Rd b/man/tidy.lmtp.Rd index 8f2ed88..09d1065 100644 --- a/man/tidy.lmtp.Rd +++ b/man/tidy.lmtp.Rd @@ -16,12 +16,12 @@ Tidy a(n) lmtp object } \examples{ -\dontrun{ +\donttest{ a <- c("A1", "A2") nodes <- list(c("L1"), c("L2")) cens <- c("C1", "C2") y <- "Y" -fit <- lmtp_tmle(sim_cens, a, y, nodes, cens = cens, shift = NULL, folds = 2) +fit <- lmtp_tmle(sim_cens, a, y, time_vary = nodes, cens = cens, shift = NULL, folds = 2) tidy(fit) }