[R] intercept in multiple regression
Bernardo Rangel Tura
tura at centroin.com.br
Fri Nov 30 10:55:31 CET 2007
On Tue, 2007-11-20 at 16:39 +0100, Irene Mantzouni wrote:
> Hi all!
> Is it possible to model a multiple regression in which the response becomes zero when one of the two covariates is zero?
> lm(y~ x1+x2) and y=0 if x1=0.
> However, when x1=0, y=x2+1(intercept).
> Does this mean I cannot have a second covariate and intercept or should I eliminate only the intercept?
> thank you!
If y=x2+1 as same y-1=x2
So you can use lm(y-1~x2-1)
Look this example
lm(formula = y - 1 ~ x2 - 1)
Your regression is y-1=-0.03041*x2 or y=1-0.03041*x2
Bernardo Rangel Tura, M.D,MPH,Ph.D
National Institute of Cardiology
More information about the R-help