Skip to content

Commit d5a3db5

Browse files
minor
1 parent 5d5be7a commit d5a3db5

File tree

5 files changed

+155
-5
lines changed

5 files changed

+155
-5
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# Contribution Guidelines
22
**All people are very much welcome to contribute to code, documentation, testing and suggestions.**
33

4-
4+
`psycho` is a beginner-friendly package. Even if you're new to all this open-source way of life, new to coding and submitting pull requests (PRs), we encourage you to try. You can submit some recommendations in the [issues](https://github.com/neuropsychology/psycho.R/issues) or start coding a function or adding some parameters, fixing a bug or just rewriting a bit so it is more clear, more documented or understandable. Then, do not hesitate to sumbit your changes. We will work together to integrate them :)
55

66
## Code
77
- Authors of code contribution will be added within the [**authors**](https://github.com/neuropsychology/psycho.R/blob/master/DESCRIPTION) section within the package description.
88
- Please document and comment your code, so that the purpose of each step (or code line) is stated in a clear and understandable way.
9-
- Avoid unnecessary function splitting into smaller bits: it makes testing and reading of the code more difficult (as one must jump between functions and files to understand what's happening).
109
- Before submitting a change, please use [**styler**](https://github.com/r-lib/styler) to nicely format your code.

docs/_posts/2018-06-11-bayesian_correlation.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ plot(density(posterior))
9292

9393
<img src="https://raw.githubusercontent.com/neuropsychology/psycho.R/master/docs/_posts/2018-06-11-bayesian_correlation_files/figure-markdown_github/unnamed-chunk-6-1.png" style="display: block; margin: auto;" />
9494

95+
96+
Contribute
97+
==========
98+
99+
Of course, these reporting standards should change, depending on new expert recommandations or official guidelines. **The goal of this package is to flexibly adaptive to new changes and good practices evolution**. Therefore, if you have any advices, opinions or such, we encourage you to either let us know by opening an [issue](https://github.com/neuropsychology/psycho.R/issues) or, even better, try to implement them yourself by [contributing](https://github.com/neuropsychology/psycho.R/blob/master/.github/CONTRIBUTING.md) to the code.
100+
101+
95102
Credits
96103
=======
97104

docs/_posts/preparation/analyze_correlation.Rmd

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
title: "APA Formatted Correlation"
33
layout: post
44
output:
5-
html_document:
6-
df_print: paged
7-
toc: yes
85
md_document:
96
toc: yes
107
variant: markdown_github
8+
html_document:
9+
df_print: paged
10+
toc: yes
1111
author: "Dominique Makowski"
1212
date: "`r Sys.Date()`"
1313
editor_options:
@@ -57,6 +57,9 @@ knitr::kable(summary(results), digits=2)
5757

5858
Nevertheless, we recommand doing a **Bayesian correlation**, which is even [easier and quicker to do](blogpostlink)!
5959

60+
# Contribute
61+
62+
Of course, these reporting standards should change, depending on new expert recommandations or official guidelines. **The goal of this package is to flexibly adaptive to new changes and good practices evolution**. Therefore, if you have any advices, opinions or such, we encourage you to either let us know by opening an [issue](https://github.com/neuropsychology/psycho.R/issues), or even better, try to implement them yourself by [contributing](https://github.com/neuropsychology/psycho.R/blob/master/.github/CONTRIBUTING.md) to the code.
6063

6164

6265
# Credits
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: "APA Formatted Correlation"
3+
layout: post
4+
output:
5+
md_document:
6+
toc: yes
7+
variant: markdown_github
8+
html_document:
9+
df_print: paged
10+
toc: yes
11+
author: "Dominique Makowski"
12+
date: "2018-06-11"
13+
editor_options:
14+
chunk_output_type: console
15+
---
16+
17+
18+
19+
20+
One of the most time-consuming part of data analysis in psychology is the copy-pasting of specific values of some R output to a manuscript or a report. This task is frustrating, prone to errors, and increase de variability of statistical reporting. At the sime time, standardizing practices of what and how to report is crucial for reproducibility and clarity. **The [psycho](https://github.com/neuropsychology/psycho.R) package was designed specifically to do this job**, at first for complex [Bayesian mixed models](https://cran.r-project.org/web/packages/psycho/vignettes/bayesian.html), but is now also compatible with basic methods, such as **correlation**.
21+
22+
# Do a correlation
23+
24+
```r
25+
df <- iris
26+
cor_results <- cor.test(df$Sepal.Length, df$Petal.Length)
27+
```
28+
29+
30+
# APA formatted output
31+
32+
33+
```r
34+
# devtools::install_github("neuropsychology/psycho.R") # Install the latest psycho version
35+
36+
# Load packages
37+
library(psycho)
38+
psycho::analyze(cor_results)
39+
```
40+
41+
```
42+
The Pearson's product-moment correlation between df$Sepal.Length and df$Petal.Length is significantly large and positive (r(148) = 0.87, 95% CI [0.83, 0.91], p < .001)
43+
```
44+
45+
46+
The formatted output includes **direction**, **effect size** (interpreted by default with **[Cohen's (1988)](https://github.com/neuropsychology/psycho.R/blob/master/R/interpret_r.R#L142)** rules) and **confidence intervals**. Now you can just copy and paste this line into your report and focus on what's important.
47+
48+
# Dataframe of Values
49+
50+
It is also possible to have all the values stored in a dataframe by running a **summary** on the analyzed object.
51+
52+
53+
```r
54+
results <- analyze(cor_results)
55+
summary(results)
56+
```
57+
58+
effect statistic df p CI_lower CI_higher
59+
------- ---------- ---- --- --------- ----------
60+
0.87 21.65 148 0 0.83 0.91
61+
62+
# Bayesian Correlation
63+
64+
Nevertheless, we recommand doing a **Bayesian correlation**, which is even [easier and quicker to do](blogpostlink)!
65+
66+
# Contribute
67+
68+
Of course, these reporting standards should change, depending on new expert recommandations or official guidelines. **The goal of this package is to flexibly adaptive to new changes and good practices evolution**. Therefore, if you have any advices, opinions or such, we encourage you to either let us know by opening an [issue](https://github.com/neuropsychology/psycho.R/issues), or even better, try to implement them yourself by [contributing](https://github.com/neuropsychology/psycho.R/blob/master/.github/CONTRIBUTING.md) to the code.
69+
70+
71+
# Credits
72+
73+
This package helped you? Don't forget to cite the various packages you used :)
74+
75+
You can cite `psycho` as follows:
76+
77+
- Makowski, (2018). *The psycho Package: An Efficient and Publishing-Oriented Workflow for Psychological Science*. Journal of Open Source Software, 3(22), 470. https://doi.org/10.21105/joss.00470
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
- [Do a correlation](#do-a-correlation)
2+
- [APA formatted output](#apa-formatted-output)
3+
- [Dataframe of Values](#dataframe-of-values)
4+
- [Bayesian Correlation](#bayesian-correlation)
5+
- [Contribute](#contribute)
6+
- [Credits](#credits)
7+
8+
One of the most time-consuming part of data analysis in psychology is the copy-pasting of specific values of some R output to a manuscript or a report. This task is frustrating, prone to errors, and increase de variability of statistical reporting. At the sime time, standardizing practices of what and how to report is crucial for reproducibility and clarity. **The [psycho](https://github.com/neuropsychology/psycho.R) package was designed specifically to do this job**, at first for complex [Bayesian mixed models](https://cran.r-project.org/web/packages/psycho/vignettes/bayesian.html), but is now also compatible with basic methods, such as **correlation**.
9+
10+
Do a correlation
11+
================
12+
13+
``` r
14+
df <- iris
15+
cor_results <- cor.test(df$Sepal.Length, df$Petal.Length)
16+
```
17+
18+
APA formatted output
19+
====================
20+
21+
``` r
22+
# devtools::install_github("neuropsychology/psycho.R") # Install the latest psycho version
23+
24+
# Load packages
25+
library(psycho)
26+
psycho::analyze(cor_results)
27+
```
28+
29+
The Pearson's product-moment correlation between df$Sepal.Length and df$Petal.Length is significantly large and positive (r(148) = 0.87, 95% CI [0.83, 0.91], p < .001)
30+
31+
The formatted output includes **direction**, **effect size** (interpreted by default with **[Cohen's (1988)](https://github.com/neuropsychology/psycho.R/blob/master/R/interpret_r.R#L142)** rules) and **confidence intervals**. Now you can just copy and paste this line into your report and focus on what's important.
32+
33+
Dataframe of Values
34+
===================
35+
36+
It is also possible to have all the values stored in a dataframe by running a **summary** on the analyzed object.
37+
38+
``` r
39+
results <- analyze(cor_results)
40+
summary(results)
41+
```
42+
43+
| effect| statistic| df| p| CI\_lower| CI\_higher|
44+
|-------:|----------:|----:|----:|----------:|-----------:|
45+
| 0.87| 21.65| 148| 0| 0.83| 0.91|
46+
47+
Bayesian Correlation
48+
====================
49+
50+
Nevertheless, we recommand doing a **Bayesian correlation**, which is even [easier and quicker to do](blogpostlink)!
51+
52+
Contribute
53+
==========
54+
55+
Of course, these reporting standards should change, depending on new expert recommandations or official guidelines. **The goal of this package is to flexibly adaptive to new changes and good practices evolution**. Therefore, if you have any advices, opinions or such, we encourage you to either let us know by opening an [issue](https://github.com/neuropsychology/psycho.R/issues), or even better, try to implement them yourself by [contributing](https://github.com/neuropsychology/psycho.R/blob/master/.github/CONTRIBUTING.md) to the code.
56+
57+
Credits
58+
=======
59+
60+
This package helped you? Don't forget to cite the various packages you used :)
61+
62+
You can cite `psycho` as follows:
63+
64+
- Makowski, (2018). *The psycho Package: An Efficient and Publishing-Oriented Workflow for Psychological Science*. Journal of Open Source Software, 3(22), 470. <https://doi.org/10.21105/joss.00470>

0 commit comments

Comments
 (0)