I want to fit a binomial model using glm package in R however I'm looking for negative values for some of the coefficients. I also have categorical independent variables which are converted to factors.
I was wondering if there is any way to add that constraint to glm or if any other packages available with such capabilities. I've also tried glmnet but the problem with that package is that it doesn't provide the significant value (p value) for all coefficients and also not all variables end up with non zero coefficient using glmnet. So even if a coefficient is not-significant I still need a value for that coefficient.
Basically what I'm looking for is:
target ~ intercept+ B1*X1+B2*X2+B3*X3+B4*X4+...
S.T. B2<0 and B3<0 and B5<0
I appreciate if anyone can help.
Thanks.