From 0224a69813701186b739d1164fb9c01c0ebd693f Mon Sep 17 00:00:00 2001 From: Isaac Gravestock Date: Mon, 18 Nov 2024 13:46:43 +0100 Subject: [PATCH 1/6] remove pipe --- R/maic_unanchored.R | 4 ++-- vignettes/anchored_binary.Rmd | 2 +- vignettes/unanchored_binary.Rmd | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/R/maic_unanchored.R b/R/maic_unanchored.R index 968ab8d3..741b1b90 100644 --- a/R/maic_unanchored.R +++ b/R/maic_unanchored.R @@ -367,7 +367,7 @@ maic_unanchored_binary <- function(res, # : fit glm for binary outcome and robust estimate with weights binobj_dat <- glm(RESPONSE ~ ARM, dat, family = glm_link) - binobj_dat_adj <- glm(RESPONSE ~ ARM, dat, weights = weights, family = glm_link) |> suppressWarnings() + binobj_dat_adj <- suppressWarnings(glm(RESPONSE ~ ARM, dat, weights = weights, family = glm_link)) bin_robust_cov <- sandwich::vcovHC(binobj_dat_adj, type = binary_robust_cov_type) bin_robust_coef <- lmtest::coeftest(binobj_dat_adj, vcov. = bin_robust_cov) @@ -424,7 +424,7 @@ maic_unanchored_binary <- function(res, } boot_dat <- rbind(boot_ipd, pseudo_ipd) boot_dat$ARM <- factor(boot_dat$ARM, levels = c(trt_agd, trt_ipd)) - boot_binobj_dat_adj <- glm(RESPONSE ~ ARM, boot_dat, weights = weights, family = glm_link) |> suppressWarnings() + boot_binobj_dat_adj <- suppressWarnings(glm(RESPONSE ~ ARM, boot_dat, weights = weights, family = glm_link)) c(est = coef(boot_binobj_dat_adj)[2], var = vcov(boot_binobj_dat_adj)[2, 2]) } diff --git a/vignettes/anchored_binary.Rmd b/vignettes/anchored_binary.Rmd index ae2c3802..d4a64d17 100644 --- a/vignettes/anchored_binary.Rmd +++ b/vignettes/anchored_binary.Rmd @@ -112,7 +112,7 @@ ipd$ARM <- stats::relevel(as.factor(ipd$ARM), ref = "C") pseudo_ipd$ARM <- stats::relevel(as.factor(pseudo_ipd$ARM), ref = "C") binobj_dat <- glm(RESPONSE ~ ARM, ipd, family = binomial(link = "logit")) -binobj_dat_adj <- glm(RESPONSE ~ ARM, ipd, weights = weights, family = binomial(link = "logit")) |> suppressWarnings() +binobj_dat_adj <- suppressWarnings(glm(RESPONSE ~ ARM, ipd, weights = weights, family = binomial(link = "logit"))) binobj_agd <- glm(RESPONSE ~ ARM, pseudo_ipd, family = binomial(link = "logit")) bin_robust_cov <- sandwich::vcovHC(binobj_dat_adj, type = "HC3") diff --git a/vignettes/unanchored_binary.Rmd b/vignettes/unanchored_binary.Rmd index 8496e3d1..d1f8652f 100644 --- a/vignettes/unanchored_binary.Rmd +++ b/vignettes/unanchored_binary.Rmd @@ -115,10 +115,12 @@ combined_data_binary <- rbind( combined_data_binary$ARM <- stats::relevel(as.factor(combined_data_binary$ARM), ref = "B") binobj_dat <- glm(RESPONSE ~ ARM, combined_data_binary, family = binomial(link = "logit")) -binobj_dat_adj <- glm(RESPONSE ~ ARM, combined_data_binary, - weights = weights, - family = binomial(link = "logit") -) |> suppressWarnings() +binobj_dat_adj <- suppressWarnings( + glm(RESPONSE ~ ARM, combined_data_binary, + weights = weights, + family = binomial(link = "logit") + ) +) bin_robust_cov <- sandwich::vcovHC(binobj_dat_adj, type = "HC3") bin_robust_coef <- lmtest::coeftest(binobj_dat_adj, vcov. = bin_robust_cov) From 1e49be48ebe80d234e2357a79523ab826ddd1277 Mon Sep 17 00:00:00 2001 From: Isaac Gravestock Date: Mon, 18 Nov 2024 13:49:13 +0100 Subject: [PATCH 2/6] higher R req --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 814a8806..34a739f8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -44,7 +44,7 @@ License: Apache License 2.0 URL: https://github.com/hta-pharma/maicplus/, https://hta-pharma.github.io/maicplus/ BugReports: https://github.com/hta-pharma/maicplus/issues Depends: - R (>= 3.6) + R (>= 4.1) Imports: graphics, grDevices, From 0cea4f7ee89962d7948bc2cad02ec3571830360e Mon Sep 17 00:00:00 2001 From: Isaac Gravestock Date: Tue, 19 Nov 2024 09:29:44 +0100 Subject: [PATCH 3/6] version bump --- DESCRIPTION | 4 ++-- NEWS.md | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 814a8806..d82facd2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Title: Matching Adjusted Indirect Comparison Package: maicplus -Version: 0.1.0 +Version: 0.1.1 Date: 2024-10-29 Authors@R: c( person( @@ -75,5 +75,5 @@ Encoding: UTF-8 Language: en-US LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.2.9000 Config/testthat/edition: 3 diff --git a/NEWS.md b/NEWS.md index ce9a6b31..81f2a9ae 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# maicplus 0.1.1 + # maicplus 0.1.0 - first CRAN release From 37aaa41290008362d8620624314c84d0cb903075 Mon Sep 17 00:00:00 2001 From: Isaac Gravestock Date: Tue, 19 Nov 2024 09:30:12 +0100 Subject: [PATCH 4/6] news --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index 81f2a9ae..b17b852d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # maicplus 0.1.1 +- bug fixes + # maicplus 0.1.0 - first CRAN release From 8d863fdc16b35e3520de0441f576f0f47810b760 Mon Sep 17 00:00:00 2001 From: Isaac Gravestock Date: Tue, 19 Nov 2024 18:01:38 +0100 Subject: [PATCH 5/6] fixed labels --- R/maic_anchored.R | 24 ++++++++++++------------ tests/testthat/_snaps/maic_anchored.md | 16 ++++++++-------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/R/maic_anchored.R b/R/maic_anchored.R index 2de557f8..a7f48b1a 100644 --- a/R/maic_anchored.R +++ b/R/maic_anchored.R @@ -703,32 +703,32 @@ maic_anchored_binary <- function(res, res$inferential[["summary"]] <- data.frame( case = c("AC", "adjusted_AC", "BC", "AB", "adjusted_AB"), EST = c( - res_AC$est, res_AC_unadj$est, + res_AC$est, res_BC$est, - res_AB$est, - res_AB_unadj$est + res_AB_unadj$est, + res_AB$est ), LCL = c( - res_AC$ci_l, res_AC_unadj$ci_l, + res_AC$ci_l, res_BC$ci_l, - res_AB$ci_l, - res_AB_unadj$ci_l + res_AB_unadj$ci_l, + res_AB$ci_l ), UCL = c( - res_AC$ci_u, res_AC_unadj$ci_u, + res_AC$ci_u, res_BC$ci_u, - res_AB$ci_u, - res_AB_unadj$ci_u + res_AB_unadj$ci_u, + res_AB$ci_u ), pval = c( - res_AC$pval, res_AC_unadj$pval, + res_AC$pval, res_BC$pval, - res_AB$pval, - res_AB_unadj$pval + res_AB_unadj$pval, + res_AB$pval ) ) names(res$inferential[["summary"]])[2] <- eff_measure diff --git a/tests/testthat/_snaps/maic_anchored.md b/tests/testthat/_snaps/maic_anchored.md index 758f5a90..5831d292 100644 --- a/tests/testthat/_snaps/maic_anchored.md +++ b/tests/testthat/_snaps/maic_anchored.md @@ -401,11 +401,11 @@ testout$inferential$summary Output case OR LCL UCL pval - 1 AC 1.3119021 0.8210000 2.0963303 2.562849e-01 - 2 adjusted_AC 1.6993007 1.2809976 2.2541985 2.354448e-04 + 1 AC 1.6993007 1.2809976 2.2541985 2.354448e-04 + 2 adjusted_AC 1.3119021 0.8210000 2.0963303 2.562849e-01 3 BC 2.3333333 1.7458092 3.1185794 1.035032e-08 - 4 AB 0.5622438 0.3239933 0.9756933 4.061296e-02 - 5 adjusted_AB 0.7282717 0.4857575 1.0918611 1.248769e-01 + 4 AB 0.7282717 0.4857575 1.0918611 1.248769e-01 + 5 adjusted_AB 0.5622438 0.3239933 0.9756933 4.061296e-02 --- @@ -540,11 +540,11 @@ testout2$inferential$summary Output case OR LCL UCL pval - 1 AC 1.3119021 0.8210000 2.0963303 2.562849e-01 - 2 adjusted_AC 1.6993007 1.2809976 2.2541985 2.354448e-04 + 1 AC 1.6993007 1.2809976 2.2541985 2.354448e-04 + 2 adjusted_AC 1.3119021 0.8210000 2.0963303 2.562849e-01 3 BC 2.3333333 1.7458092 3.1185794 1.035032e-08 - 4 AB 0.5622438 0.3239933 0.9756933 4.061296e-02 - 5 adjusted_AB 0.7282717 0.4857575 1.0918611 1.248769e-01 + 4 AB 0.7282717 0.4857575 1.0918611 1.248769e-01 + 5 adjusted_AB 0.5622438 0.3239933 0.9756933 4.061296e-02 --- From c8c3ce52cdb626df1e63ea7ffd273debe096074c Mon Sep 17 00:00:00 2001 From: Isaac Gravestock <83659704+gravesti@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:52:27 +0100 Subject: [PATCH 6/6] Update DESCRIPTION --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 376e421d..58901d05 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -75,5 +75,5 @@ Encoding: UTF-8 Language: en-US LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.2.9000 +RoxygenNote: 7.3.2 Config/testthat/edition: 3