I have estimated the model
$y = \beta_{0} + \beta_{1}x + u$
I want to test the restriction that $\beta_{0} = 3$ and that $\beta_{1} = -2$. after setting both betas to their hypothesized values and rearranging, I get the equation:
$z = u$ where $z = y + 2x -3$
now I am lost as to how to actually run this regression because there are no independent variable and no intercept as well. if the value for the intercept was not restricted then i would simply define a new variable as $y + 2x$ and just compute it's ssr and use it to compute an F-statistics.
R
:anova(lm(y ~ x), {y <- y - (3 + -2*x); lm(y ~ 0)})
. There's a trick involved: you have to foolanova
into believing you used the same response variable in both models--you can't give them different names (likey
andy.1
, say). $\endgroup$lm(y ~ 0)
basically askslm
to treaty
as if it were the residuals (which it is, relative to your null model) and perform its standard calculations. It doesn't do any fitting (which it cheerfully tells you when you applyprint
orsummary
to its output). $\endgroup$