# Thread: Constrained Regression in Stata

1. ## Constrained Regression in Stata

Hi!

I need to do a constrained regression in stata-I need all the beta coefficents to sum to 1.

I have 11 independent variables so my regression is:
reg Rrf bills it lt cor lcvalue lcgrowth medcap smallcap noncanbonds us jap if fundno ==`i'

I need all the betas to sum to 1 and there to be a constant.
Can anyone help me with this? Im relatively new to Stata and cant figure this out at all!!

Thanks a lot!

2. When it comes to statistical software, always check out UCLA's Academic Technology Services (ATS) for statistical computing. They have an impressive library of stuff online. For instance, 4.2 Constrained Linear Regression. I hope that helps. If not, search around their website for Stata stuff. I'm an R person, myself, so I can't answer specifics about Stata.

3. Thanks for your reply. I found that alright but I couldnt adapt what is there is what I need. Im still new enough to Stata so not that good!

4. I'm not familiar with the Stata interface, but from the examples it reminds me of another program I used for an econ class (Gretl). Using their example, I would think you define a constraint like:

constraint define 1 math + science = 0
. cnsreg response math science predictors, c(1)

Like I said, I'm not familiar with Stata statements, and don't have the resources at the moment to test them out. I would do a Google search for "Stata constraint", "Stata constraint ~definition", and "Stata cnsreg". The last one is important since that seems to be the commend to do a constrained regression based on a defined constraint which is defined by the key words "constraint define ..." If you know what results you are supposed to get, try it out. If it doesn't work, you may need to look into the documentation you can find online.