Skip to content

Commit

Permalink
fix inconsistency
Browse files Browse the repository at this point in the history
  • Loading branch information
fanbu1995 committed Dec 6, 2023
1 parent be7c9b6 commit 0864621
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/Balance.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ computeMeansPerGroup <- function(cohorts, cohortMethodData) {
ungroup()
}

# By definition:
sumW <- 1

if (hasStrata && any(stratumSize %>% pull(.data$n) > 1)) {
# Variable strata sizes detected: weigh by size of strata set
w <- stratumSize %>%
Expand All @@ -55,8 +58,6 @@ computeMeansPerGroup <- function(cohorts, cohortMethodData) {
mutate(overallWeight = .data$weight / overallWSum) %>%
select("rowId", "overallWeight")

# By definition:
sumW <- 1

# Note: using abs() because due to rounding to machine precision number can become slightly negative:
result <- cohortMethodData$covariates %>%
Expand Down

0 comments on commit 0864621

Please sign in to comment.