-
Notifications
You must be signed in to change notification settings - Fork 9
/
README.Rmd
83 lines (55 loc) · 3.26 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
output:
md_document:
variant: gfm
---
<!-- README.md is generated from README.Rmd. Please edit that file
rmarkdown::render("README.rmd")
-->
```{r, echo = FALSE}
library(badger)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
[![Build Status](https://travis-ci.org/nicebread/BFDA.svg?branch=master)](https://travis-ci.org/nicebread/BFDA)
[![Last-changedate](https://img.shields.io/badge/last%20change-`r gsub('-', '--', Sys.Date())`-yellowgreen.svg)](/commits/master)
```{r, echo = FALSE}
version <- as.vector(read.dcf('package/DESCRIPTION')[, 'Version'])
version <- gsub('-', '.', version)
```
[![packageversion](https://img.shields.io/badge/Package%20version-`r version`-orange.svg?style=flat-square)](commits/master)
<!--
`r badge_codecov("nicebread/BFDA")`
-->
# BFDA Bayes factor design analysis #
### Installation
The BFDA package is not on CRAN yet, but you can install the development version from Github:
library(devtools)
install_github("nicebread/BFDA", subdir="package")
For installations on Windows the package requires R version 3.3.1 or higher.
## How to use the BFDA package?
### 1. Read our papers:
- Schönbrodt, F. D. & Wagenmakers, E.-J. (2018). Bayes Factor Design Analysis: Planning for compelling evidence. *Psychonomic Bulletin & Review*, 25, 128-142. doi:10.3758/s13423-017-1230-y. [[PDF](https://osf.io/d4dcu)][[OSF project with reproducible code](https://osf.io/v7yxp/)]
- Stefan, A. M., Gronau, Q. F., Schönbrodt, F. D., & Wagenmakers, E. (2018). A Tutorial on Bayes Factor Design Analysis with Informed Priors. [PsyArXiv Preprint](https://doi.org/10.31234/osf.io/aqr79)
If you use this package to compute and report your design analysis, please cite it as:
- Schönbrodt, F. D. & Stefan, A. M. (2019). BFDA: An R package for Bayes factor design analysis (version 0.5.0). Retrieved from https://github.com/nicebread/BFDA
### 2. Read the additional [manual](https://rawgit.com/nicebread/BFDA/master/package/doc/BFDA_manual.html).
![Sequential Design](https://github.com/nicebread/BFDA/blob/master/movies/GIF1/BFDA1.gif)
### 3. Look at published use cases of BFDA
We compile a (non-exhaustive) list of papers that user BFDA in practice: [A list of published examples](BFDA_examples.md)
## Extending the BFDA package
If you want to implement a new test (e.g., a BFDA for regression or ANOVAs): The BFDA package uses a rather modular system for creating new tests. For new tests, you need to:
1. Add a new file with 4 functions:
- `sample.function`
- `select.function`
- `BF.test.function`
- `freq.test.function`
Replace "function" with the test name, e.g.: sample.ANOVA etc.
2. Add the new "type" (e.g., "ANOVA") to the `print.BFDA` function in `R/1-Simulation.R`
3. Add the new "type" (e.g., "ANOVA") to the `BFDA.sanityCheck` function in `R/10-SanityChecks.R`
4. Do a lot of testing!
Probably it is easiest to take one of the existing test implementations (e.g., `R/t.between.R` or `R/correlation.R`) and replace the name and the content of the functions.
If you implement a new test, please let us know. The preferred workflow would be that you fork the Github project, implement the test, do a lot of testing, and send us a pull request. If everything works as intended, we can add the test to the main project.