[R] Constrained Regression

2011-01-20 Thread Jackie Chen
Hi everyone, I'm trying to perform a linear regression y = b1x1 + b2x2 + b3x3 + b4x4 + b5x5 while constraining the coefficients such that -3 = bi = 3, and the sum of bi =1. I've searched R-help and have found solutions for constrained regression using quadratic programming (solve.QP) where the

Re: [R] Constrained Regression

2011-01-20 Thread Samuel Le
should just do that for you. HTH, Samuel -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jackie Chen Sent: 20 January 2011 16:31 To: R-help@r-project.org Subject: [R] Constrained Regression Hi everyone, I'm trying to perform

Re: [R] Constrained Regression

2010-10-31 Thread Jim Silverton
Hello everyone, I have 3 variables Y, X1 and X2. Each variables lies between 0 and 1. I want to do a constrained regression such that a0 and (1-a) 0 for the model: Y = a*X1 + (1-a)*X2 I tried the help on the constrained regression in R but I concede that it was not helpful. Any help is greatly

Re: [R] Constrained Regression

2010-10-31 Thread Ravi Varadhan
- From: Jim Silverton jim.silver...@gmail.com Date: Sunday, October 31, 2010 2:45 am Subject: Re: [R] Constrained Regression To: r-help@r-project.org Hello everyone, I have 3 variables Y, X1 and X2. Each variables lies between 0 and 1. I want to do a constrained regression such that a0

Re: [R] Constrained Regression

2010-10-31 Thread David Winsemius
On Oct 31, 2010, at 2:44 AM, Jim Silverton wrote: Hello everyone, I have 3 variables Y, X1 and X2. Each variables lies between 0 and 1. I want to do a constrained regression such that a0 and (1-a) 0 for the model: Y = a*X1 + (1-a)*X2 It would not accomplish the constraint that a 0 but

Re: [R] Constrained Regression

2010-10-31 Thread Spencer Graves
Have you tried the 'sos' package? install.packages('sos') # if not already installed library(sos) cr - ???'constrained regression' # found 149 matches summary(cr) # in 69 packages cr # opens a table in a browser listing all 169 matches with links to the help pages However, I agree

Re: [R] Constrained Regression

2010-10-31 Thread David Winsemius
On Oct 31, 2010, at 12:54 PM, Spencer Graves wrote: Have you tried the 'sos' package? I have, and I am taking this opportunity to load it with my .Rprofile to make it more accessible. It works very well. Very clean display. I also have constructed a variant of RSiteSearch that I find

Re: [R] Constrained Regression

2010-10-31 Thread Jim Silverton
I thought I would 'add' some meat to the problem I sent. This is all I know (1) f = a*X1 + (1-a)*X2 (2) I know n values of f and X1 which happens to be probabilities (3) I know nothing about X2 except that it also lies in (0,1) (4) X1 is the probability under the null (fisher's exact test) and X2

Re: [R] Constrained Regression

2010-10-31 Thread Spencer Graves
in line On 10/31/2010 6:26 PM, Jim Silverton wrote: I thought I would 'add' some meat to the problem I sent. This is all I know (1) f = a*X1 + (1-a)*X2 How do you know f = a*X1 + (1-a)*X2? Why does this relationship make more sense than, e.g., log(f/(1-f)) = a*X1 + (1-a)*X2? (2) I

[R] Constrained regression

2008-03-05 Thread Carlos Alzola
I would like to acknowledge the answers I received from Tom Filloon, Mike Cheung and Berwyn Turlach. Berwyn's response was exactly what I needed. Use solve.QP from the quadprog package in R. S-Plus has the equivalent function solveQP in the NuOpt module. Berwyn's response is below G'day Carlos,

Re: [R] Constrained regression

2008-03-03 Thread Mike Cheung
Dear Carlos, One approach is to use structural equation modeling (SEM). Some SEM packages, such as LISREL, Mplus and Mx, allow inequality and nonlinear constraints. Phantom variables (Rindskopf, 1984) may be used to impose inequality constraints. Your model is basically: y = b0 + b1*b1*x1 +

Re: [R] Constrained regression

2008-03-03 Thread Berwin A Turlach
G'day Carlos, On Mon, Mar 3, 2008 at 11:52 AM Carlos Alzola [EMAIL PROTECTED] wrote: I am trying to get information on how to fit a linear regression with constrained parameters. Specifically, I have 8 predictors , their coeffiecients should all be non-negative and add up to 1. I

[R] Constrained regression

2008-03-02 Thread Carlos Alzola
Dear list members, I am trying to get information on how to fit a linear regression with constrained parameters. Specifically, I have 8 predictors , their coeffiecients should all be non-negative and add up to 1. I understand it is a quadratic programming problem but I have no experience in the