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

Add residuals convenience function to docs #445

Merged
merged 2 commits into from
Dec 23, 2021

Conversation

ym-han
Copy link
Contributor

@ym-han ym-han commented Sep 5, 2021

Preliminary attempt at adding discussion of residuals convenience function to docs, since it's in the code (and obviously in StatsBase), but not, as far as I can tell, mentioned otherwise anywhere in any of the docs.

@ym-han
Copy link
Contributor Author

ym-han commented Sep 5, 2021

This is my first real PR to a Julia package repo, so please forgive me if I've made any mistakes in setting this up.

@@ -146,6 146,7 @@ F-test: 2 models fitted on 50 observations
Many of the methods provided by this package have names similar to those in [R](http://www.r-project.org).
- `coef`: extract the estimates of the coefficients in the model
- `deviance`: measure of the model fit, weighted residual sum of squares for lm's
- `residuals`: returns the vector of residuals. This yields the same vector as `@. sign(y - predict(model)) * sqrt(devresid(d, y, predict(model)))`, where `d` is the distribution object that was used with the original `lm` call.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just use a short description for consistency with other functions in the list:

Suggested change
- `residuals`: returns the vector of residuals. This yields the same vector as `@. sign(y - predict(model)) * sqrt(devresid(d, y, predict(model)))`, where `d` is the distribution object that was used with the original `lm` call.
- `residuals`: return the vector of residuals

Also probably better put it after predict, since these are quire similar.

If you feel like adding more information, it could go to a docstring instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've taken on board your suggestion for the residuals stuff under the Many of the methods heading. I've also moved the note about how residuals returns the same thing as the longer code block involving devresid to the docstring for devresid (since that's probably where the question will come up for folks), though feel free to disregard that if you don't think it'll be useful.

src/glmtools.jl Outdated Show resolved Hide resolved
@ym-han
Copy link
Contributor Author

ym-han commented Dec 17, 2021

Sorry about taking so long to get to this; I got busy with school. Let me know if there's anything else you would like me to add or fix.

@nalimilan
Copy link
Member

Something seems to have gone wrong when rebasing: many unrelated changes appear in the diff, and there are conflicts.

@ym-han
Copy link
Contributor Author

ym-han commented Dec 22, 2021

Sorry about that; I'll fix it by tomorrow night.

@ym-han ym-han reopened this Dec 22, 2021
@ym-han
Copy link
Contributor Author

ym-han commented Dec 22, 2021

OK this should be fixed / be what we want now

docs/src/index.md Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Merging #445 (69cb024) into master (64ec692) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #445    /-   ##
=======================================
  Coverage   84.01%   84.01%           
=======================================
  Files           7        7           
  Lines         807      807           
=======================================
  Hits          678      678           
  Misses        129      129           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64ec692...69cb024. Read the comment docs.

@nalimilan nalimilan merged commit 8da427b into JuliaStats:master Dec 23, 2021
@nalimilan
Copy link
Member

Thanks!

@ym-han ym-han deleted the residuals-manual branch December 23, 2021 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants