Skip to content

Commit

Permalink
v0.2.20
Browse files Browse the repository at this point in the history
  • Loading branch information
yh202109 committed Jul 12, 2024
1 parent c7e5b87 commit 2dec7c2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/statlab_corr_spearman_rho.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ We can calculate the rank of a single sample as
R_{i^*1} = s1 + \frac{s2+1}{2} = n - s3 - \frac{s-1}{2}.
For a vector, `pandas.DataFrame` has the `rank` function with `method='average'` option to calculate rank as defined in :eq:`eq_rank`.
In `R`, that can be calculated using the `rank` function with `ties.method='average'` option.
See reference [2]_ for ranking in `Julia`.
For a vector, ``pandas.DataFrame`` has the ``rank`` function with ``method='average'`` option to calculate rank as defined in :eq:`eq_rank`.
In ``R``, that can be calculated using the ``rank`` function with ``ties.method='average'`` option.
See reference [2]_ for ranking in ``Julia``.

The Spearman's :math:`\rho` can be calculated as:

Expand Down Expand Up @@ -141,6 +141,8 @@ To use ``scipy.stats`` [3]_:
rho, p_value = spearmanr(y1, y2)
print("Spearman's rho:", rho)
*************
Reference
*************
Expand Down

0 comments on commit 2dec7c2

Please sign in to comment.