Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: add example for stats.mstats.compare_median_ms #14068

Merged
merged 4 commits into from Feb 23, 2022

Conversation

sudosoph
Copy link
Contributor

Reference issue

#7168

Description

Added example for stats.mstats.compare_median_ms. Provided example usage for method.

@mdhaber
Copy link
Contributor

mdhaber commented May 18, 2021

Thanks @sudosoph! There are a few CI failures we'll need to fix.

By clicking "Details" at the scipy.scipy (Main Lint) check and clicking some more until you get to the terminal output, we see

./scipy/stats/mstats_extras.py:435:80: E501 line too long (244 > 79 characters)
./scipy/stats/mstats_extras.py:436:80: E501 line too long (138 > 79 characters)

We need to follow PEP8 line length conventions, so please break those up.

scipy.scipy (Main refguide_asv_check) is telling us:

/home/circleci/repo/build/testenv/lib/python3.7/site-packages/scipy/stats/mstats_extras.py:docstring of scipy.stats.mstats_extras.compare_medians_ms:57: WARNING: Unknown target name: "1".

It doesn't know what you meant when you referenced the target [1]_ in the code on line 412, I think.

If you take a look at references in other files or at the numpydoc standards, you'll see two .. need to come before each reference number (e.g. .. [1]) in the References section. You need those dots to define the reference - otherwise Sphinx thinks that [1] is just normal text.

Oops, didn't mean to close! Re-opened though. Please try to fix these and I'll take another look.

@mdhaber mdhaber closed this May 18, 2021
@mdhaber mdhaber reopened this May 18, 2021
scipy/stats/mstats_extras.py Outdated Show resolved Hide resolved
scipy/stats/mstats_extras.py Outdated Show resolved Hide resolved
scipy/stats/mstats_extras.py Outdated Show resolved Hide resolved
scipy/stats/mstats_extras.py Outdated Show resolved Hide resolved
scipy/stats/mstats_extras.py Outdated Show resolved Hide resolved
@tupui tupui added the Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org label May 18, 2021
@rgommers rgommers changed the title Added example for compare_median_ms DOC: add example for stats.mstats.compare_median_ms May 26, 2021
@mdhaber
Copy link
Contributor

mdhaber commented Feb 23, 2022

Previously, the PR referenced "Introduction to Robust Estimation and Hypothesis Testing" and seemed to refer to this part:
image

but the test shown there:
image

does not appear to be what is going on in the code. Instead, I added a reference to McKean & Schrader. "A comparison of methods for studentizing the sample median." I'm not sure if it actually suggests this test, but it will at least point the reader in the right direction.

Without a good reference, I decided not to try to add notes about what this function actually does (returns just a p-value, apparently), because although it appears reasonable, I'm not sure how valid the test is. I would open an issue to review this stuff more thoroughly, but I think gh-14651 is leaning toward unifying stats and mstats, at which point we can reconsider these mstats tests that don't have references.

[skip azp] [skip actions]
@mdhaber mdhaber merged commit 428b4e4 into scipy:main Feb 23, 2022
@mdhaber
Copy link
Contributor

mdhaber commented Feb 23, 2022

Thanks @sudosoph!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org scipy.stats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants