# Linear Regression with constraint(s): need s.e., t-stat, and p-values of the regressors

I am performing a linear regression and what I need is (1) to constrain the sum of the regression coefficients to 1, and (2) to constrain the sum of regression coefficients to 1 AND each regression coefficient to be non-negative. For each case, I need the standard error, t-stat and p values for each regression coefficient as it appears in an unconstrained linear regression.

I have tried the solve.QP command and I get correct results but I do not get the t-stat and p-values as in a linear regression How do I fit a constrained regression in R so that coefficients total = 1? I have looked at the "constreg" command in "coneproj" package and I am not successful. Should I try the nls command? I am not sure on how to add a constraint(s) to it. And also the fact that the formula is for a linear regression.

Thank you very much for your help and support. Supratim

• "Regressor" means predictor/covariate and you can't put constraints on that. If you meant to say "parameter" please edit your post. And if you want exact inference in complex situations use a Bayesian model. Nov 28 '20 at 11:38
• Yes, sorry, I meant the sum of regression coefficients to be 1 and that each regression coefficient is non-negative. I need to know how have their t-stat and p-values along with their estimates. Sorry for the confusion Nov 28 '20 at 11:45
• The non-negativity constraints forces the null hypothesis to be false so you needn't bother with statistical tests. The "sum to 1" constraint can be handled by reparameterizing the model with one less regression coefficient. Nov 28 '20 at 12:09