Skip to content

Commit

Permalink
fix for calibrated estimation regarding #50
Browse files Browse the repository at this point in the history
  • Loading branch information
LukaszChrostowski committed May 30, 2024
1 parent f0eb12b commit 9c41bd1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ summary.nonprobsvy <- function(object,
} else {
se_mean <- NULL
}
if (class(object)[2] %in% c("nonprobsvy_dr", "nonprobsvy_ipw")) {
est_totals <- object$selection$est_totals
} else {
est_totals <- "no value for the selected method"
}
res <- structure(
list(
call = object$call,
Expand All @@ -126,7 +131,7 @@ summary.nonprobsvy <- function(object,
likelihood = ifelse(class(object)[2] %in% c("nonprobsvy_dr", "nonprobsvy_ipw"), object$selection$log_likelihood, "no value for the selected method"),
df_residual = ifelse(class(object)[2] %in% c("nonprobsvy_dr", "nonprobsvy_ipw"), object$selection$df_residual, "no value for the selected method"),
weights = summary(object$weights),
est_totals = ifelse(class(object)[2] %in% c("nonprobsvy_dr", "nonprobsvy_ipw"), object$selection$est_totals, "no value for the selected method"),
est_totals = est_totals,
coef = cf,
std_err = se,
w_val = wald_test_stat,
Expand Down

0 comments on commit 9c41bd1

Please sign in to comment.