Skip to content

Commit e428d47

Browse files
committed
missed a trt_var
1 parent 8fb00dc commit e428d47

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

R/maic.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ calc_maic <- function(strategy,
120120
list(R = strategy$R,
121121
formula = strategy$formula,
122122
family = strategy$family,
123+
trt_var = strategy$trt_var,
123124
data = ipd,
124125
ald = ald)
125126

R/parse_formula.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11

22
#' Guess treatment name
3-
#'
3+
#'
4+
#' Does a variable appear more than once in interactions?
5+
#' Otherwise pick first LHS interaction term.
6+
#' So this doesnt work without an effect modifier.
7+
#'
48
#' @eval reg_args(include_formula = TRUE, include_family = FALSE)
59
#'
610
#' @return Treatment name
@@ -25,7 +29,7 @@ guess_treatment_name <- function(formula) {
2529
# take the first term
2630
treat_nm <- strsplit(interaction_terms[1], ":")[[1]][1]
2731
} else {
28-
stop("Treatment name missing from formula.")
32+
stop("Unable to guess the treatment name from formula.")
2933
}
3034
}
3135

0 commit comments

Comments
 (0)