I have a model of the form: $y_i = \beta_0 + \beta_1 x_1 +\beta_2 x_2 +\epsilon_i$ . I want to test the null hypothesis that $\beta_1 + \beta_2 =2$, by creating a restricted model imposing these restrictions. My idea was to create a new variable, call it $restrictions$ and make it the equation $\beta_1 + \beta_2 =2$ and then input this equation into a restricted regression, call it R,
R <- lm(y_i ~ restrictions, data = mydata)
This was just what occurred to me, I have never dealt with multiple linear restrictions equal to something non-trivial such as zero, which would make this a much more straightforward affair as I would be able to just exclude them, e.g. $\beta_1=0$
I also want to be able to fit my restrictions into the general form of $R \beta = r$ where R is a qx(k+1) with rank(R)=q<k+1 and r is qx1, and q is the number of restrictions.