Skip to content

Commit

Permalink
Merge pull request #88 from sfcheung/devel
Browse files Browse the repository at this point in the history
Update to 0.1.9.6
  • Loading branch information
sfcheung committed Apr 12, 2023
2 parents 491b586 + 8797bd0 commit d70a168
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: manymome
Title: Mediation, Moderation and Moderated-Mediation After Model Fitting
Version: 0.1.9.5
Version: 0.1.9.6
Authors@R:
c(person(given = "Shu Fai",
family = "Cheung",
Expand Down
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# manymome 0.1.9.5
# manymome 0.1.9.6

- Updated badges in README.md. (0.1.9.1)
- Updated pkgdown site. (0.1.9.2)
- Added support for Monte Carlo confidence intervals. (0.1.9.3 to 0.1.9.4)
- Updated some vignettes for Monte Carlo confidence intervals. (0.1.9.5)
- Used a more reliable test for Monte Carlo CIs. (0.1.9.6)
- Fixed an error in pkgdown site. (0.1.9.6)
- Updated the logo for readability. (0.1.9.6)

# manymome 0.1.9

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![R-CMD-check](https://github.com/sfcheung/manymome/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/sfcheung/manymome/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

(Version 0.1.9.5, updated on 2023-04-12, [release history](https://sfcheung.github.io/manymome/news/index.html))
(Version 0.1.9.6, updated on 2023-04-12, [release history](https://sfcheung.github.io/manymome/news/index.html))

# manymome <img src="man/figures/logo.png" align="right" height="150" />

Expand Down
2 changes: 2 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ reference:
- lm2boot_out
- fit2boot_out
- fit2boot_out_do_boot
- do_mc
- fit2mc_out
- title: For 'lavaan'
- contents:
- factor2var
Expand Down
2 changes: 1 addition & 1 deletion inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ bibentry(
textVersion =
paste("Cheung, S. F., & Cheung, S.-H. (2023).",
"manymome: An R package for computing the indirect effects, conditional effects, and conditional indirect effects.",
"R package version 0.1.9.5",
"R package version 0.1.9.6",
"https://github.com/sfcheung/manymome/")
)
Binary file modified man/figures/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/apple-touch-icon-120x120.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/apple-touch-icon-152x152.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/apple-touch-icon-180x180.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/apple-touch-icon-60x60.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/apple-touch-icon-76x76.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/apple-touch-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/favicon-16x16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/favicon-32x32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/favicon.ico
Binary file not shown.
22 changes: 16 additions & 6 deletions tests/testthat/test_index_mome.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ ind_momome_mc <- index_of_momome(x = "x", y = "y", m = "m1", w = "w1", z = "w4",
# confint(ind_momome)
# print(parameterEstimates(fitmomo_boot)[32, c("est", "ci.lower", "ci.upper")], nd = 8)

user_perc <- function(x, level = .95) {
boot_out <- list(t0 = mean(x, na.rm = TRUE),
t = matrix(x, ncol = 1),
R = length(x))
out0 <- boot::boot.ci(boot_out,
type = "perc",
conf = level)$percent[4:5]
out0
}

test_that("index_of_mome and index_of_momome", {
expect_equal(
coef(ind_mome1),
Expand Down Expand Up @@ -138,20 +148,20 @@ test_that("index_of_mome and index_of_momome, Monte Carlo", {
)
expect_equal(
unlist(confint(ind_mome1_mc)),
quantile(ind_mome1_mc$mc_diff, probs = c(.025, .975)),
tolerance = 1e-2,
user_perc(ind_mome1_mc$mc_diff),
tolerance = 1e-4,
ignore_attr = TRUE
)
expect_equal(
unlist(confint(ind_mome2_mc)),
quantile(ind_mome2_mc$mc_diff, probs = c(.025, .975)),
tolerance = 1e-1,
user_perc(ind_mome2_mc$mc_diff),
tolerance = 1e-4,
ignore_attr = TRUE
)
expect_equal(
unlist(confint(ind_momome_mc)),
quantile(ind_momome_mc$mc_diff, probs = c(.025, .975)),
tolerance = 1e-1,
user_perc(ind_momome_mc$mc_diff),
tolerance = 1e-4,
ignore_attr = TRUE
)
})

0 comments on commit d70a168

Please sign in to comment.