s-news
[Top] [All Lists]

OLS or lm without a intercept

To: <s-news@lists.biostat.wustl.edu>
Subject: OLS or lm without a intercept
From: "Chen,Sichong" <sichong.chen@postgrad.manchester.ac.uk>
Date: Thu, 23 Nov 2006 05:07:54 +0800
Thread-index: AccOeka98BzUB+flRfuZiZbgi3TWeQ==
Dear Users

I have a question that how I can not include an intercept in OLS or lm
linear regression Function.

From the help, I find that lm (A~B-1)  using "-1" can exclude the intercept,
which works for OLS as well.

However, if I have more than one independent variable, it does not work. For
example, lm(A~B+C-1) which only report one coefficient. I tried to make B+C
as a matrix. But it still does not work. Does anyone have some idea how to
solve this problem with more than one independent variable?

Many thanks,
Best regards,

Sichong
SPlus 7.0 & FinMetrics 2.0 User
Windows XP




<Prev in Thread] Current Thread [Next in Thread>
  • OLS or lm without a intercept, Chen,Sichong <=