Re: [R] fix sign of a coefficient in formula

2011-01-20 Thread Prof Brian Ripley
Fitting a linear model with constraints is a completely different task from fitting one without -- and it is the fit you want to constrain, not the formula. See CRAN package nnls to fit a linear model with sign constraints. If you have range constraints you can use nls(algorithm="port") since

[R] fix sign of a coefficient in formula

2011-01-20 Thread Peter Schmidtke
Dear R users & experts, I'd like to create a model using lm (or glm) under some constraints of how coefficients for each component could look like (sort of a range of coefficients that should be allowed). So let's go for an example : model=lm(age ~ eyecolor + height, data=inputdata) So let's sup