Skip to content

Commit

Permalink
Merge pull request #163 from IndrajeetPatil/master
Browse files Browse the repository at this point in the history
address CRAN comments
  • Loading branch information
IndrajeetPatil authored Apr 6, 2021
2 parents 336151b + 728813b commit 1995e1b
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 21 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,5 @@ VignetteBuilder:
knitr
Encoding: UTF-8
Language: en-US
LazyData: true
RoxygenNote: 7.1.1.9001
Config/testthat/edition: 3
6 changes: 3 additions & 3 deletions R/cor_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
#' redundant. Nonetheless, it is an easy option to increase the robustness of the
#' correlation as well as flexible way to obtain Bayesian or multilevel
#' Spearman-like rank correlations.
#' @param robust Old name for \code{ranktransform}. Will be removed in subsequent
#' versions, so better to use \code{ranktransform} which is more explicit about
#' @param robust Old name for \code{ranktransform}. Will be removed in subsequent
#' versions, so better to use \code{ranktransform} which is more explicit about
#' what it does.
#' @param winsorize Another way of making the correlation more "robust" (i.e.,
#' limiting the impact of extreme values). Can be either \code{FALSE} or a
Expand Down Expand Up @@ -138,7 +138,7 @@ cor_test <- function(data,
...) {

# Deprecation warnings
if(!is.null(robust)) {
if (!is.null(robust)) {
warning("The 'robust' argument is deprecated in favour of 'ranktransform' (more explicit). Please use the latter instead to remove this warning.")
ranktransform <- robust
}
Expand Down
2 changes: 1 addition & 1 deletion R/correlation.R
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ correlation <- function(data,
...) {

# Deprecation warnings
if(!is.null(robust)) {
if (!is.null(robust)) {
warning("The 'robust' argument is deprecated in favour of 'ranktransform' (more explicit). Please use the latter instead to remove this warning.")
ranktransform <- robust
}
Expand Down
2 changes: 2 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

0 errors | 0 warnings | 0 note

* Fixes `NOTE`s and `WARNING`s in `R CMD CHECK` for last released version.

## revdepcheck results

We checked 4 reverse dependencies, comparing R CMD check results across CRAN and
Expand Down
2 changes: 1 addition & 1 deletion inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ dichotomously
doi
easystats
et
favour
favours
fieller
frac
Expand All @@ -82,7 +83,6 @@ pracma
ressembles
rmarkdown
semipartial
severly
spearman
tetrachoric
th
Expand Down
4 changes: 2 additions & 2 deletions man/cor_test.Rd

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

4 changes: 2 additions & 2 deletions man/correlation.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-display_print_matrix.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if (require("testthat") && require("gt") && require("dplyr")) {
if (require("testthat") && require("gt") && require("dplyr")) {

# display and print method works - markdown -----------------------------

Expand Down
8 changes: 4 additions & 4 deletions vignettes/multilevel.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ bibliography: bibliography.bib

This vignette can be cited as:

Makowski, D., Ben-Shachar, M. S., Patil, I., & Lüdecke, D. (2019). Methods
and Algorithms for Correlation Analysis in R. _Journal of Open Source Software_, _5_(51), 2306. doi:10.21105/joss.02306
```{r cite}
citation("correlation")
```

---

Expand Down Expand Up @@ -102,8 +103,7 @@ ggplot(data, aes(x = V1, y = V2)) +
```

Mmh, interesting. It seems like, for each subject, the relationship is
different. The negative general trend seems to be created by **differences
between the groups** and could be spurious!
different. The (global) negative trend seems to be an artifact of **differences between the groups** and could be spurious!

**Multilevel *(as in multi-group)* ** correlations allow us to account for
**differences between groups**. It is based on a partialization of the group,
Expand Down
13 changes: 7 additions & 6 deletions vignettes/types.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,17 @@ if (!requireNamespace("see", quietly = TRUE) ||

This vignette can be cited as:

Makowski, D., Ben-Shachar, M. S., Patil, I., & Lüdecke, D. (2019). Methods
and Algorithms for Correlation Analysis in R. _Journal of Open Source Software_, _5_(51), 2306. doi:10.21105/joss.02306
```{r cite}
citation("correlation")
```

---

## Different Methods for Correlations

Correlations tests are arguably one of the most commonly used statistical
procedures, and are used as a basis in many applications such as exploratory
data analysis, structural modelling, data engineering etc. In this context, we
data analysis, structural modeling, data engineering, etc. In this context, we
present **correlation**, a toolbox for the R language [@Rteam] and part of the
[**easystats**](https://github.com/easystats/easystats) collection, focused on
correlation analysis. Its goal is to be lightweight, easy to use, and allows for
Expand Down Expand Up @@ -130,7 +131,7 @@ binary variable is assumed to have an underlying continuity. For example,
anxiety level can be measured on a continuous scale, but can be classified
dichotomously as high/low.

- **Winsorized correlation**: Correlation of variables that have been formerly
- **Winsorized correlation**: Correlation of variables that have been
Winsorized, i.e., transformed by limiting extreme values to reduce the effect of
possibly spurious outliers.

Expand All @@ -141,7 +142,7 @@ distributed continuous latent variables, from two observed ordinal variables.
applicable when both observed variables are dichotomous.

- **Partial correlation**: Correlation between two variables after adjusting for
the (linear) the effect of one or more variables. The correlation test is here
the (linear) effect of one or more variables. The correlation test is
run after having partialized the dataset, independently from it. In other words,
it considers partialization as an independent step generating a different
dataset, rather than belonging to the same model. This is why some discrepancies
Expand All @@ -154,7 +155,7 @@ $$r_{xy.z} = r_{e_{x.z},e_{y.z}}$$

- **Multilevel correlation**: Multilevel correlations are a special case of
partial correlations where the variable to be adjusted for is a factor and is
included as a random effect in a mixed model.
included as a random effect in a mixed-effects model.

## Comparison

Expand Down

0 comments on commit 1995e1b

Please sign in to comment.