How to fix one coefficient and fit others using regression I would like to manually fix a certain coefficient, say $\beta_1=1.0$, then fit coefficients to all other predictors, while keeping $\beta_1=1.0$ in the model.
How can I achieve this using R? I'd particularly like to work with LASSO (glmnet) if possible. 
Alternatively, how can I restrict this coefficient to a specific range, say $0.5\le\beta_1\le1.0$?
 A: You need to use the offset argument like this:
library(glmnet)
x=matrix(rnorm(100*20),100,20)
x1=matrix(rnorm(100),100,1)
y=rnorm(100)
fit1=glmnet(x,y,offset=x1)
fit1$offset
print(fit1)

About the range ... I don't think that has been implemented in glmnet. If they use some numerical method, you may want to dig into the R code and try to restrict it over there, but you'll need a good, solid programming background.
A: With respect to constraining coefficients to be within a range, a Bayesian approach to estimation is one means to accomplish this. 
In particular, one would rely on a Markov Chain Monte Carlo. First, consider a Gibbs sampling algorithm, which is how you would fit the MCMC in a Bayesian framework absent the restriction. In Gibbs sampling, in each step of the algorithm you sample from the posterior distribution of each parameter (or group of parameters) conditional on the data and all other parameters. Wikipedia provides a good summary of the approach. 
One way to constrain the range is to apply a Metropolis-Hastings step. The basic idea is to simply throw out any simulated variable that is outside of your bounds. You could then keep re-sampling until that is within your bounds before moving on to the next iteration. The downside to this is that you might get stuck simulating a lot of times, which slows down the MCMC. An alternative approach, originally developed by John Geweke in a few papers and extended in a paper by Rodriguez-Yam, Davis, Sharpe is to simulate from a constrained multivariate normal distribution. This approach can handle linear and non-linear inequality constraints on parameters and I've had some success with it.
A: I'm not familiar with LASSO or glmnet, but lavaan (short for "latent variable analysis") facilitates multiple regression models with both equality constraints and single-bounded inequality constraints (see the table on page 7 of this PDF, "lavaan: An R package for structural equation modeling"). I don't know if you could have both upper and lower bounds on the coefficient, but maybe you could add each bound with separate lines, e.g:
Coefficient>.49999999
Coefficient<1.0000001

Of course, if you're standardizing everything before fitting the model, you shouldn't have to worry about imposing an upper bound of 1 on your regression coefficients anyway. I'd say you're better off omitting it in this case, just in case something goes wrong! (lavaan is still in beta after all...I've seen some slightly fishy results in my own limited use of it thus far.)
A: Well, let's think. You have:
$Y = b_0 + b_1x_1 + b_2x_2 + e$
(to keep it simple)
You  want to force $b_1 = 1$ so, you want
$Y = b_0 + x_1 + b_2x_2 + e$
so you could just subtract $x_1$ from each side leaving:
$Ynew = Y-x_1 = b_0 + b_2x_2 + e$
which can then estimate $b_2$.
