-
Notifications
You must be signed in to change notification settings - Fork 5
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
Improved handling of vcov. in summary(), anova(), confint(), etc. with enhanced documentation #22
Conversation
… into separate code and documentation files
In the explanation of the Otherwise, the changes to the code, documentation, etc., seem fine to me. |
Actually, I see that one of the examples does pass an argument to the |
Thanks for the feedback John! https://github.com/zeileis/ivreg/blob/vcov/man/summary.ivreg.Rd#L117-L138 Do you think it would be better to use more than one type of covariance? Or should I bring out more clearly that |
I think that the current examples are adequate, though it might help to clarify the equivalence of different approaches; e.g.:
That said, it wouldn't hurt to introduce another example or examples with different |
Thanks, John. I made the examples more explicit but I couldn't think of a good second Moreover, I've added a I'm running tests on the Win builder and will then send the new version to CRAN. |
I took a look at the latest changes and they seem fine to me. Thanks for doing all this. |
I tested the commit, and it is working well. The documentation is also clear. I would suggest enforcing the matrix rule, though, to avoid confusion and improve consistency. For instance, This work as expected
And this returns
However, these two return the same diagnostics, but the vcov. the argument is ignored in the second line because it is a matrix (compare to the results of
So, people can easily make mistakes when they write the second line, thinking they are getting the diagnostics with robust (or clustered; the same applies in that case) std. errors when they are not. The code won't tell them that they are using the incorrect result. If you ignore |
I'm not sure what you are saying here. Why do you find this surprising?
You have disabled the diagnostics ( And in this case you get a warning:
The alternative would have been to throw an error which I found a bit extreme given we haven't even warned about this so far. Note also that "enforcing the matrix rule" is not possible in this case because the variance-covariance matrix needs to be extracted from an auxiliary model and not just from |
In any case the package is out on CRAN now: https://CRAN.R-project.org/package=ivreg The NEWS https://zeileis.github.io/ivreg/news/ explains the update and links to the |
Ah, ok. I disable warnings by default bc I think they are annoying, so I didn't see you added that message when I ran it. In any case, I would throw an error or return Null if people tried to pass a matrix to vcov. to avoid mistakes. This is a design choice, but can induce mistake. Thanks for adding the changes. |
John, following the discussions with Diogo I have:
vcov.
in thesummary()
method, throwing a warning if it is a matrix butdiagnostics = TRUE
vcov.
through...
anova()
andconfint()
vcov.
argumentDESCRIPTION
andNEWS
correspondinglyIt would be great if you could have a look whether you see any problems or inconcsistencies. Thanks!