You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello Noah!
When I try to use the functions bal.tab or love.plot on an output from twang::mnps, it gives the following error. My treatment variable has 5 categories and is a factor. Could you advise on this?
Error in `bal.tab()`:
! The argument to `treat` must be a vector of treatment statuses or the (quoted) name of a variable in `data` that contains treatment statuses.
---
Backtrace:
▆
1. ├─cobalt::bal.tab(mnps, un = TRUE, disp = c("m", "sd"))
2. │ └─base::eval.parent(.call)
3. │ └─base::eval(expr, p)
4. │ └─base::eval(expr, p)
5. ├─cobalt::bal.tab(x = `<mnps>`, un = TRUE, disp = c("m", "sd"))
6. └─cobalt:::bal.tab.mnps(...)
7. ├─base::do.call("x2base.ps", c(list(x), args), quote = TRUE)
8. └─cobalt:::x2base.ps(...)
9. └─cobalt:::process_treat(ps[["treat"]], datalist = list(data, ps.data))
10. └─cobalt:::.process_vector(...)
11. └─cobalt:::.err(...)
12. └─chk::err(..., call = pkg_caller_call(start = 2))
Run rlang::last_trace(drop = FALSE) to see 1 hidden frame.
Code that I ran:
> mnps <- mnps(treatment ~ sex + age + ,
data = psdf,
estimand = "ATT",
treatATT = "treat1",
verbose = "False",
stop.method = c("es.mean"),
n.trees = 2000)
> bal.tab(mnps, un = TRUE, disp = c("m", "sd"))
Versions
R version 4.3.0 (2023-04-21)
x86_64-pc-linux-gnu
cobalt 4.5.1
twang 2.5
Thanks in advance, let me know what other info i can provide!
The text was updated successfully, but these errors were encountered:
Hi, that looks like a bug, which I'll fix shortly. In the meantime, you can always use the formula interface to bal.tab(), which is only a tiny bit more cumbersome:
Hello Noah!
When I try to use the functions bal.tab or love.plot on an output from twang::mnps, it gives the following error. My treatment variable has 5 categories and is a factor. Could you advise on this?
Code that I ran:
Versions
Thanks in advance, let me know what other info i can provide!
The text was updated successfully, but these errors were encountered: