generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
123 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# From: | ||
# Richard Valliant and George Zipf (2023). PracTools: Designing and | ||
# Weighting Survey Samples. R package version 1.4.2. | ||
# https://CRAN.R-project.org/package=PracTools | ||
|
||
# Kish design effect | ||
# Kish design effect due to unequal weights | ||
# w: vector of inverses of selection probabilities for a sample | ||
|
||
# deffK = function (w) | ||
deffK = function(prob) | ||
{ | ||
w = 1 / prob | ||
assert_that(all(w > 0), all(w < Inf)) | ||
|
||
# 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)) | ||
ret | ||
} |
157 changes: 75 additions & 82 deletions
157
docs/articles/Example-National-Ambulatory-Medical-Care-Survey-NAMCS-tables.html
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters