Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
astra-cdc committed Feb 29, 2024
1 parent d9fa92c commit e449c53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions R/z_deffK.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ deffK = function(prob)

# if (any(w <= 0))
# warning("Some weights are less than or equal to 0.\n")
n <- length(w)
ret = 1 + sum((w - mean(w))^2)/n/mean(w)^2
assert_that(all(ret > 0))
# n <- length(w)
# ret = 1 + sum((w - mean(w))^2)/n/mean(w)^2
ret = 1 + mean((w - mean(w))^2)/mean(w)^2
# assert_that(all(ret > 0))
assert_that(all(ret >= 1)) # Second term >= 0
ret
}
2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pkgdown_sha: ~
articles:
Example-National-Ambulatory-Medical-Care-Survey-NAMCS-tables: Example-National-Ambulatory-Medical-Care-Survey-NAMCS-tables.html
surveytable: surveytable.html
last_built: 2024-02-29T02:56Z
last_built: 2024-02-29T15:32Z
urls:
reference: https://cdcgov.github.io/surveytable/reference
article: https://cdcgov.github.io/surveytable/articles
Expand Down

0 comments on commit e449c53

Please sign in to comment.