[R] A comment about R:
Achim Zeileis
Achim.Zeileis at wu-wien.ac.at
Thu Jan 5 21:13:46 CET 2006
Peter:
> My two most immediate problems were a) to test whether a set of coefficients
> were jointly zero (as Achim suggests, though the complication here is that
> the varcov matrix is bootstrapped), but also b) to test whether the average
This can be tested with both waldtest() and linear.hypothesis() when
you've got the bootstrapped vcov estimator of your choice available. This
can be conveniently plugged into both functions (either as a vcov matrix
or as a function extracting the vcov matrix from the fitted model object).
There is some discussion about this in the vignette accompanying the
sandwich package.
> of a set of coefficients was equal to zero. At other points in time, I
> remember having had to test more complex linear hypotheses involving joint
> combinations of equality, non-zero, and 'averages.' The Stata interface for
> linear hypothesis tests is amazingly straightforward. For example, after a
> regression, I could use the following to test the joint hypothesis that
> v1=v2 and the average (or sum) of v3 through v5 is zero and .75v6+.25v7 is
> zero:
>
> test v1=v2
> test v3+v4+v5=0, accum
> test .75*v6+.25*v7=0, accum
Mmmh, should be possible to derive the restriction matrix from this
together with the terms structure...I'll think about this.
> I don't even have to set up a matrix for my test ];-) ! The output would
> show not merely the joint test of all the hypotheses but the tests along the
> way, one for each line of commands. I vaguely remember the hypothesis
> testing command after an ml run is much the same and cross-equation
> hypothesis tests simply involve adding an equation indicator to the terms.
> I can get huberized var-cov matrices simply by adding "robust" to the
> regression command.
Whether you find this simple or not depends on what you might want to
have. Personally, I always find it very limiting if I've only got a switch
to choose one or another vcov matrix when there is a multitude of vcov
matrices in use in the literature. What if you would want to do HC3
instead of the HC(0) that is offered by Eviews...or HC4...or HAC...or
something bootstrapped...or...
In my view, this is the stengths of many implementation in R: you can make
programs very modular so that the user can easily extend the software or
re-use it for other purposes. The price you pay for that is that it is not
as easy to as a point-and-click software that offers some standard tools.
Of course, both sides have advantages or disadvantages.
> I won't claim to know what's good for R or the R community, but it would be
> nice for me and perhaps others if there were a comparable straightforward
> command as in Stata that could meet a variety of needs. I need to play w/
> the commands that have been suggested to me by you guys recently, but I'm
> looking at a multitude of commands none of which I suspect have the
> flexibility and ease of use of the above Stata commands, at least for the
> kind of applications I'd like. Perhaps the point of R isn't to serve as a
> package for a wider set of non-statisticians, but if it wishes to develop in
> that direction, facilities like this may be helpful.
The point of R is hard to determine, R itself does not wish this or that,
it is an open source project which is driven by many contributors. If
there are people out there that want to use R for social sciences, they
are free to contribute to the project. And in this particular case, I
think that there has been some activity in the last one or two years
aiming at providing tools for econometrics, quantitative methods in the
social and political sciences.
However, you won't be very happy with R when you want R to be Stata. If
you want Stata, use it.
> It's interesting that
> Achim points out that a function John suggests is already available in R--an
> indication that even R experts don't have a complete handle on everything in
> R even on a relatively straightforward topic like hypothesis tests.
In fairness to John, this functionality became available rather recently.
And it's not surprising that John knows his car package better and that
I'm more familiar with my lmtest package. Therefore, it's very natural to
think first how you would do a certain task using your own package...in
particular given that you specifically asked about car.
> John is no doubt right that editorializing about statistics would be out of
> place on an R help page. But when I have gone to statistical papers, many
> have been difficult to access & not very helpful for practical concerns.
> I'm glad to hear that Long and Erwin's paper is helpful, but there's a
> goodly list of papers mentioned in help.
I would think this to be an advantage not a drawback. It's the user's
responsiblity to know what he/she is doing.
Best wishes,
Z
More information about the R-help
mailing list