[R-SIG-Finance] constrained OLS regression

Frederick Novomestky frednovo at pipeline.com
Tue Dec 30 18:01:52 CET 2008


The lm function has an option for removing the intercept which I've copied 
below from the lm help page

A formula has an implied intercept term.  To remove this use
      either 'y ~ x - 1' or 'y ~ 0 + x'.  See 'formula' for more details
      of allowed formulae.

Regards,

Fred Novomestky

At 10:40 PM 12/29/2008, Bastian Offermann wrote:
>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
>
>_______________________________________________
>R-SIG-Finance at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>-- Subscriber-posting only.
>-- If you want to post, subscribe first.

Frederick Novomestky, Ph.D.
Novomestky Associates LLC
41 Eastover Drive
East Northport, NY 11731-4330
Vox: 1.631.368.0701
Fax: 1.631.368.1696
URL: http://www.novoassoc.com

Confidentiality Notice: This electronic mail transmissio...{{dropped:10}}



More information about the R-SIG-Finance mailing list