-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix row name for the prevalence ratio in methods_epi2x2.R (#944)
* Fix row name for the prevalence ratio in methods_epi2x2.R insight::get_parameters() returns something named "RR" and not "PR". * fix * typo * typo * fixes --------- Co-authored-by: Daniel <[email protected]>
- Loading branch information
1 parent
1bd2884
commit 3649723
Showing
5 changed files
with
46 additions
and
20 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
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,17 @@ | ||
skip_on_cran() | ||
skip_if_not_installed("epiR") | ||
|
||
test_that("model_parameters.epi2x2", { | ||
data(mtcars) | ||
tab <- xtabs(~ am + vs, data = mtcars) | ||
out <- model_parameters(epiR::epi.2by2(tab)) | ||
expect_identical(out$Parameter, c("RR", "OR", "ARisk", "AFRisk", "PARisk", "PAFRisk")) | ||
expect_identical( | ||
attributes(out)$pretty_names, | ||
c( | ||
RR = "Risk Ratio", OR = "Odds Ratio", ARisk = "Attributable Risk", | ||
AFRisk = "Attributable Fraction in Exposed (%)", PARisk = "Attributable Risk in Population", | ||
PAFRisk = "Attributable Fraction in Population (%)" | ||
) | ||
) | ||
}) |