[R] Multiple linear regression with constraint (imposition)

Ravi Varadhan rvaradhan at jhmi.edu
Sat Oct 31 04:42:55 CET 2009


Simply do this:

    lm(y ~ I(X1 - X2))


Ravi.
____________________________________________________________________

Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology
School of Medicine
Johns Hopkins University

Ph. (410) 502-2619
email: rvaradhan at jhmi.edu


----- Original Message -----
From: "CE.KA" <ce.kaya75 at yahoo.fr>
Date: Friday, October 30, 2009 7:48 pm
Subject: Re: [R] Multiple linear regression with constraint (imposition)
To: r-help at r-project.org


> Sorry there was a mistake:
> 
> Hi R users
> 
> I want to do a multiple linear regression with R
> 
> With a normal model (Y=Cste+A1*X1+A2*X2) the program would be
> lm(Y~X1+X2)
> 
> My model is Y=Cste+A1*X1+A2*X2 with the constraint A1=-A2
> What is the program for such a model?
> 
> Best regards
> 
> 
> -- 
> View this message in context: 
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> 
> PLEASE do read the posting guide 
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list