I'm working with R on a sample of 145 observations. I have created five subsamples each with 29 observations, while the response variable q
has been sorted. As a result, subset1 contains the 29 lines of the data frame with the lowest output, subset2 contains the following 29 lines, etc.
I am regressing the variable q
on the predictors x1
, x2
ans x3
. I now need to perform two experiments :
- Constraining the error variance to be the same over all subsamples;
- Constraining the coefficients on
x2
andx3
as well as the error variance to be the same over the 5 OLS regressions.
So far my approach has been to use the package plm
which allows to perform panel regressions. However, I don't know to specifically constrain the error variance, or specific coefficients. Besides, I think there must be a way to do this with the more basic tools incorporated in R.
Please don't hesitate to provide alternative methods. Thanks in advance for your help !