Skip to content

Commit

Permalink
Merge branch 'feature/fix_aux_reg_predict' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
dmphillippo committed Jun 20, 2024
2 parents d2f6869 + 309ccb9 commit fb6915a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: multinma
Title: Bayesian Network Meta-Analysis of Individual and Aggregate Data
Version: 0.7.1.9000
Version: 0.7.1.9001
Authors@R:
person(given = c("David", "M."),
family = "Phillippo",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# multinma 0.7.1.9000

* Fix: Predictions for non-proportional hazards IPD NMA or ML-NMR survival
models using `aux_regression = ~.trt` were incorrectly omitting the treatment
effects on the auxiliary parameter(s) in some cases (#43).

# multinma 0.7.1

* Fix: Producing survival/hazard/cumulative hazard predictions for survival
Expand Down
11 changes: 10 additions & 1 deletion R/predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,16 @@ predict.stan_nma <- function(object, ...,
if (!aux_int) { #(length(setdiff(object$aux_by, c(".study", ".trt"))) == 0) {
aux_s <- grepl(paste0("\\[(", paste(aux_l, collapse = "|"), if (object$likelihood %in% c("mspline", "pexp")) ")," else ")\\]"),
dimnames(aux_array)[[3]])
aux_array_s <- aux_array[ , , aux_s, drop = FALSE]

# Add in arm-level aux regression terms, if present
if (!is.null(object$aux_regression)) {
aux_array_s <- make_aux_predict(aux = aux_array[ , , aux_s, drop = FALSE],
beta_aux = beta_aux,
X_aux = X_aux[ss[1], , drop = FALSE],
likelihood = object$likelihood)
} else {
aux_array_s <- aux_array[ , , aux_s, drop = FALSE]
}

} else {
# Aux regression or stratified aux pars within arm, need to expand these out over the individuals/integration points
Expand Down

0 comments on commit fb6915a

Please sign in to comment.