diff --git a/DESCRIPTION b/DESCRIPTION index 814a8806..58901d05 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( @@ -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, diff --git a/NEWS.md b/NEWS.md index ce9a6b31..b17b852d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# maicplus 0.1.1 + +- bug fixes + # maicplus 0.1.0 - first CRAN release 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/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/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 --- 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)