Skip to content

Commit ce6f3d8

Browse files
committed
Updates
1 parent bb350a1 commit ce6f3d8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

R/weightit2ebal.R

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,10 @@ weightit2ebal <- function(covs, treat, s.weights, subset, estimand, focal,
255255
silent = TRUE)
256256
})
257257

258-
if (!null_or_error(out) && out$estim.precis < 1e-5) {
258+
if (!null_or_error(out) && utils::hasName(out, "root") &&
259+
utils::hasName(out, "estim.precis") &&
260+
chk::vld_number(out[["estim.precis"]]) &&
261+
out[["estim.precis"]] < 1e-5) {
259262
coef_start <- out$root
260263
}
261264
}
@@ -536,8 +539,10 @@ weightit2ebal.cont <- function(covs, treat, s.weights, subset, missing, moments,
536539
silent = TRUE)
537540
})
538541

539-
if (!null_or_error(out) && is.finite(out$estim.precis) &&
540-
out$estim.precis < 1e-5) {
542+
if (!null_or_error(out) && utils::hasName(out, "root") &&
543+
utils::hasName(out, "estim.precis") &&
544+
chk::vld_number(out[["estim.precis"]]) &&
545+
out[["estim.precis"]] < 1e-5) {
541546
coef_start <- out$root
542547
}
543548
}

0 commit comments

Comments
 (0)