Skip to content

Commit

Permalink
Merge pull request #4 from pxr687/correlation-update
Browse files Browse the repository at this point in the history
catch missing np.abs()
  • Loading branch information
matthew-brett authored May 30, 2024
2 parents f046b49 + 05d25dd commit a3a10a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mean-slopes/Correlation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ misused. Before using $r$, it is important to be aware of what
correlation does and does not measure.


### A Permutation Test for the Correlation Coefficient
## A Permutation Test for the Correlation Coefficient ##

We can perform a permutation test for the correlation coefficient in a very similar manner to the
permutation tests we have seen previously.
Expand Down Expand Up @@ -487,7 +487,7 @@ correlation coefficients that were as extreme or more extreme than the actual co
to the actual correlation coefficient, ignoring the direction (+ or -) of the coefficients.

```{python}
p_value = np.count_nonzero(results >= np.abs(r))/n_iters
p_value = np.count_nonzero(np.abs(results) >= np.abs(r))/n_iters
p_value
```
Expand Down

0 comments on commit a3a10a8

Please sign in to comment.