lundi 4 février 2019

Recovering full variance-covariance matrix from linear model with linear coefficient restrictions

I am having a trouble with recovering variance-covariance matrix of linear model with coefficient restrictions. The unrestricted model is

y = beta0 + beta1 * x1 + beta2 * x2 + beta3 * x3

The restricted model has the equality constraint, beta1=beta2. Following the usual convention, I ran linear model using isolation function I(), as follows:

restricted.model <- lm(y~ I(x1 + x2) + x3, data=Data)

But vcov(restricted.model) gave 3*3 matrix with column and row names given by [(intercept), I(x1 + x2), x3], instead of 4*4 matrix of with column and row names of[(intercept), x1, x2, x3]. Is there any easy way to recover the full variance-covariance matrix under the restricted model? My model is much bigger than what I exemplified here, and I want to avoid any mistake in filling out the missing elements.

Aucun commentaire:

Enregistrer un commentaire