Hi Lucy,
From the
homework so far, it seems that we haven't HAD to do anything in
linear.hypothesis that we couldn't have done in anova. is this right? if
so, what is it that linear.hypothesis CAN do that anova can't, and if
not, where have I gone drastically wrong on the problem set?
R's anova() function can't (easily) be used to test the hypothesis
that beta1 = beta2 or any hypothesis that multiple coefficients are
equal to each other but not necessarily equal to some predefined
constant. I added the "easily" above b/c anova() could test such an
hypothesis if you rewrote the lm() to fit a model that imposed the
constraint that holds under the null. This is a lot more work that it
is worth given the fact that linear.hypothesis() does what you want.
It is the case that everything that anova() can do linear.hypothesis()
can also do. The advantage of using anova() is that you don't have to
think about what L and c should look like. Instead you just need to
fit two models to *exactly the same data* and feed them in to anova().
Hope this helps.
Best,
Kevin