n.vialma <at> libero.it <n.vialma <at> libero.it> writes:

> I would like to know how to estimate in R a restricted model. 
> The model would be:
> 
> y=beta*X1+(1-beta)*X2
> 
> so the sum of coefficients must be one. I wonder if there is an option in the 
> lm function that allows to specify that restriction or any other solutions to 
> get the expected results.

  isn't this the same as y=(a)+beta*(X1-X2) ?

 lm(y~I(X1-X2))

 If you really want a zero intercept, put '-1' in the formula

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to