Skip to content

Commit

Permalink
fixes #576
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusbarth committed Jan 9, 2024
1 parent 4df1164 commit 4b1c325
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
3 changes: 3 additions & 0 deletions R/apa_print_htest.R
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ apa_print.htest <- function(
x_list
, stringsAsFactors = FALSE
)
y$number.of.successes <- NULL
y$number.of.trials <- NULL

if(!identical(conf_int, list(NULL))) y$conf.int <- conf_int

# sanitize table ----
Expand Down
3 changes: 3 additions & 0 deletions R/lookup_tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ lookup_names <- c(
, "delta" = "estimate"
, "proportion" = "estimate"
, "p" = "estimate"
# binomial test:
, "probability.of.success" = "estimate"
# estimate from effectsize package
, "Eta2" = "estimate"
, "Eta2_partial" = "estimate"
Expand Down Expand Up @@ -167,6 +169,7 @@ lookup_labels <- c(
, "difference.in.proportions" = "$\\Delta \\hat\\pi$"
, "proportion" = "$\\hat\\pi$"
, "p" = "$\\hat\\pi$"
, "probability.of.success" = "$\\hat\\pi$"
, "delta" = "$\\delta$"
# estimate from effectsize package
, "Eta2" = "$\\hat{\\eta}^2$"
Expand Down
4 changes: 2 additions & 2 deletions man/lookup_tables.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions tests/testthat/test_apa_print_htest.R
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,22 @@ test_that(
}
)

test_that(
"Binomial test"
, {
binom_test_output <- binom.test(10, 20, p = .8, conf.level = .9) |>
papaja::apa_print()
expect_apa_results(
binom_test_output
, labels = list(
estimate = "$\\hat\\pi$"
, conf.int = "90\\% CI"
, p.value = "$p$"
)
)
}
)

test_that(
"Bartlett test"
, {
Expand Down

0 comments on commit 4b1c325

Please sign in to comment.