[R-SIG-Finance] constrained OLS regression

Bastian Offermann bastian2507hk at yahoo.co.uk
Tue Dec 30 04:40:21 CET 2008


Hi,

does anybody know how to run a constrained OLS regression where the 
intercept is 0.

r = a + b * y + e

a = 0

??

The following was suggested for a different example, but i dont quite 
know how to transfer this to my problem:

"""""""""""""I don't know STATA, but if you want to force a specific regression 
coefficient to be 1, I think that can be done with the formula.  
Consider the following: 

      DF <- data.frame(x1=1:6, x2=rep(1:2, 3), y=rep(1:3, 2))
      lm(y-x1~x2-1, DF)

      The formula "y-x1~x2-1" fits a noconstant model, specified by the 
"-1" of y-x1 regressed on x2. 

      Does this answer the question? 
      spencer graves"""""""""""""""""""""""



Thanks in advance.

Regards



More information about the R-SIG-Finance mailing list