[R] Linear Regression with Linear Equality Constraint

Comcast dwinsemius at comcast.net
Mon Oct 31 22:42:03 CET 2011



On Oct 31, 2011, at 5:12 PM, Comcast <dwinsemius at comcast.net> wrote:

> 
> 
> On Oct 31, 2011, at 3:31 PM, Bert Gunter <gunter.berton at gene.com> wrote:
> 
>> Well, if I understand the question correctly (following the posting guide
>> would have spared guessing, as usual), forget packages -- nothing more than
>> elementary algebra is needed.
>> 
>> e.g.
>> 
>> lm(y ~ x1 + x2 + x3)  subject to the constraint beta_2 = beta_3, the
>> coefficients of x2 and x3, is the same as
>> 
>> lm (y ~ x1 + z)   where z = x3 + x3 (sum of the 2 covariate vectors).
>> 
> 
> I would have expected to divide the beta_z by 2 to get the beta2 = beta3. Did I  over-think this?

I think I underthunk it.

Y ~ beta1*X1 + beta1*X2 = beta1*( X1+X2)

-- 
David.

> 
> -- 
> David
>> etc. etc.   ...  ???
>> 
>> -- Bert
>> 
>> On Mon, Oct 31, 2011 at 12:16 PM, Kristian Lind <
>> kristian.langgaard.lind at gmail.com> wrote:
>> 
>>> I believe the package systemfit can help you with that. Haven't tried it
>>> myself, but give it a go.
>>> 
>>> Regards,
>>> 
>>> Kristian
>>> 
>>> 2011/10/31 JW <jon at phatrasecurities.com>
>>> 
>>>> Please advice on the package I should use to run a linear regression
>>> model
>>>> (weighted least squared) with linear equality constraint.  I initially
>>>> tried
>>>> "constrOptim" but it turned out that it only supported inequality linear
>>>> constraint.  Thank you very much in advance.
>>>> 
>>>> Cheers,
>>>> 
>>>> Jon
>>>> 
>>>> --
>>>> View this message in context:
>>>> 
>>> http://r.789695.n4.nabble.com/Linear-Regression-with-Linear-Equality-Constraint-tp3956588p3956588.html
>>>> Sent from the R help mailing list archive at Nabble.com.
>>>> 
>>>> ______________________________________________
>>>> R-help at r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>> PLEASE do read the posting guide
>>>> http://www.R-project.org/posting-guide.html
>>>> and provide commented, minimal, self-contained, reproducible code.
>>>> 
>>> 
>>>      [[alternative HTML version deleted]]
>>> 
>>> ______________________________________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide
>>> http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>> 
>> 
>> 
>> 
>> -- 
>> 
>> Bert Gunter
>> Genentech Nonclinical Biostatistics
>> 
>> Internal Contact Info:
>> Phone: 467-7374
>> Website:
>> http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm
>> 
>>   [[alternative HTML version deleted]]
>> 
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list