JSmediation
R package to conduct mediation analysis using joint significance.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
✓DOI references
Found 8 DOI reference(s) in README -
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (19.5%) to scientific vocabulary
Keywords
mediation
mediation-analysis
psychology
r
Last synced: 9 months ago
·
JSON representation
Repository
R package to conduct mediation analysis using joint significance.
Basic Info
- Host: GitHub
- Owner: cedricbatailler
- License: other
- Language: R
- Default Branch: main
- Homepage: http://cedricbatailler.me/JSmediation/
- Size: 21.7 MB
Statistics
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 10
- Releases: 6
Topics
mediation
mediation-analysis
psychology
r
Created over 7 years ago
· Last pushed over 1 year ago
Metadata Files
Readme
Changelog
License
Code of conduct
README.Rmd
---
output: github_document
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# JSmediation
[](https://cran.r-project.org/package=JSmediation)
[](https://github.com/cedricbatailler/JSmediation/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/github/cedricbatailler/JSmediation/tree/main)
## Overview
`JSmediation` is an R package aiming to provide a set of functions to conduct
mediation analysis joint-significance tests. The goal of `JSmediation` is to
provide a consistent syntax to conduct joint-significance tests.
This is motivated by the fact that joint-significance tests perform
better in terms of false positive rate control than other tests like
bootstrap-based methods (Yzerbyt, Muller, Batailler, & Judd, 2018). To
do so, it provides a family of `mdt_*` functions helping one conducting
different mediation analysis.
Current implemented models are:
- simple mediation (`mdt_simple`)
- within-participant mediation (`mdt_within`, but see also
`mdt_within_wide`)
- moderated mediation (`mdt_moderated`)
Every `mdt_*` functions take at least four arguments: `data` (the data
frame containing the data to be used),`IV` (the unquoted column name of
the independent variable in the data frame), `DV` (the unquoted column
name of the dependent variable in the data frame), and `M` (the unquoted
column name of the mediator in the data frame).
## Installation
You can install the released version of JSmediation from
[CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("JSmediation")
```
You can install the development version from
[GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("cedricbatailler/JSmediation", build_vignettes = TRUE)
```
## How to use JSmediation
```{r}
library(JSmediation)
```
The `JSmediation` package contains several functions as well as example
data sets that can be used as an example. The `ho_et_al` data set comes
from Ho et al. (2017; Exp. 3) and contains variables to test a simple
mediation. As a simple example, we will conduct a joint-significance
test of the indirect effect of discrimination on hypodescent passing by
linked fate.
We will first recode `condition` variable which is a character to a
contrast code using the `build_contrast` function.
```{r}
data("ho_et_al")
ho_et_al$condition_c <- build_contrast(ho_et_al$condition,
"High discrimination",
"Low discrimination")
head(ho_et_al)
```
Now, we can conduct a joint significant test using the `mdt_simple`
function.
```{r}
JS_model <- mdt_simple(ho_et_al,
DV = hypodescent,
IV = condition_c,
M = linkedfate)
JS_model
```
One will have to make sure that both *a* and *b* are significant to
conclude that there is a mediation pattern.
### References
Yzerbyt, V., Muller, D., Batailler, C., & Judd, C. M. (2018). New
recommendations for testing indirect effects in mediational models: The
need to report and test component paths. *Journal of Personality and
Social Psychology*, *115*(6), 929–943. doi:
[10.1037/pspa0000132](https://dx.doi.org/10.1037/pspa0000132)
Ho, A. K., Kteily, N. S., & Chen, J. M. (2017). "You're one of us":
Black Americans' use of hypodescent and its association with
egalitarianism. *Journal of Personality and Social Psychology*,
*113*(5), 753-768. doi:
[10.1037/pspi0000107](https://dx.doi.org/10.1037/pspi0000107)
## Getting help
If you encounter a clear bug or have a question please file an issue
with a minimal reproducible example on
[GitHub](https://github.com/cedricbatailler/JSmediation/issues).
## Contributing
Contributions are absolutely welcome. Please note that this project is
released with a [Contributor Code of
Conduct](https://github.com/cedricbatailler/JSmediation/blob/master/CODE_OF_CONDUCT.md).
By participating in this project you agree to abide by its terms.
Owner
- Name: Cedric Batailler
- Login: cedricbatailler
- Kind: user
- Location: Grenoble - France
- Company: Univ. Grenoble Alpes
- Website: cedricbatailler.me
- Twitter: cedricbatailler
- Repositories: 4
- Profile: https://github.com/cedricbatailler
Behavioral scientist focusing on social psychology. R and JS developer.
GitHub Events
Total
- Release event: 1
- Push event: 11
- Pull request event: 7
- Create event: 5
Last Year
- Release event: 1
- Push event: 11
- Pull request event: 7
- Create event: 5
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Cedric Batailler | c****r@g****m | 114 |
| Cedric Batailler | c****r@h****m | 37 |
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 13
- Total pull requests: 41
- Average time to close issues: 5 months
- Average time to close pull requests: 5 days
- Total issue authors: 4
- Total pull request authors: 1
- Average comments per issue: 0.31
- Average comments per pull request: 0.2
- Merged pull requests: 38
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 4
- Average time to close issues: N/A
- Average time to close pull requests: 36 minutes
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- cedricbatailler (9)
- mattansb (2)
- liam-essig (1)
- IndrajeetPatil (1)
- yardenashur (1)
Pull Request Authors
- cedricbatailler (50)
Top Labels
Issue Labels
enhancement (5)
question (2)
Pull Request Labels
enhancement (5)
internal (1)
Packages
- Total packages: 1
-
Total downloads:
- cran 318 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 7
- Total maintainers: 1
cran.r-project.org: JSmediation
Mediation Analysis Using Joint Significance
- Homepage: https://jsmediation.cedricbatailler.me/
- Documentation: http://cran.r-project.org/web/packages/JSmediation/JSmediation.pdf
- License: MIT + file LICENSE
-
Latest release: 0.2.3
published over 1 year ago
Rankings
Stargazers count: 18.3%
Forks count: 21.0%
Dependent repos count: 23.9%
Average: 24.1%
Downloads: 28.6%
Dependent packages count: 28.7%
Maintainers (1)
Last synced:
10 months ago
Dependencies
DESCRIPTION
cran
- R >= 2.10 depends
- MASS * imports
- broom * imports
- data.table * imports
- dplyr * imports
- glue * imports
- knitr * imports
- magrittr * imports
- purrr * imports
- rlang >= 0.4.9 imports
- stats * imports
- tibble * imports
- utils * imports
- covr * suggests
- lavaan * suggests
- markdown * suggests
- mediation * suggests
- patchwork * suggests
- performance * suggests
- processR * suggests
- rmarkdown * suggests
- roxygen2 * suggests
- see >= 0.6.5 suggests
- stringr * suggests
- testthat >= 3.0.2 suggests
- vdiffr * suggests
- withr * suggests
.github/workflows/R-CMD-check.yaml
actions
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/upload-artifact main composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
.github/workflows/pkgdown.yaml
actions
- actions/cache v2 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
.github/workflows/test-coverage.yaml
actions
- actions/cache v2 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite