Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# maicplus 0.1.1

- bug fixes

# maicplus 0.1.0

- first CRAN release
24 changes: 12 additions & 12 deletions R/maic_anchored.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions R/maic_unanchored.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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])
}

Expand Down
16 changes: 8 additions & 8 deletions tests/testthat/_snaps/maic_anchored.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

---

Expand Down Expand Up @@ -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

---

Expand Down
2 changes: 1 addition & 1 deletion vignettes/anchored_binary.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
10 changes: 6 additions & 4 deletions vignettes/unanchored_binary.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading