- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have to run this linear regression
y = a +b1 x1 + b2 x2 +u
with b1, b2 >0 and b1+b2=1
proc reg would be perfect but it doesn't accept inequality constraints.
viceversa, proc nlin would be ok but it doesn't accept equality constraints.
one possibility would be proc nlin with
y= a + exp(c1) x1 + (1-exp(c1)) x2 + u
Do you have a better solution?
thank you
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
bounds 0 < a1 < a2 < a3 < 1;
y = a0 + a1*x1 + (a2-a1)*x2 + (a3-a2)*x3 + (1-a3)*x4;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
In proc nlin, use bounds
bounds 0 < C < 1;
and equation
y = a + C x1 + (1-C) x2 + u;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
thank you but with 3 (or more) parameters?
y=a0+ a1 x1 + a2 x2 + a3 x3
becomes
y= a0 + a1 x1 +a2 x2 + (1-a1-a2) x3
bounds 0< a1 < 1
bounds 0 < a2 <1
and the constraint 0 < a3 < 1 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
bounds 0 < a1 < a2 < a3 < 1;
y = a0 + a1*x1 + (a2-a1)*x2 + (a3-a2)*x3 + (1-a3)*x4;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
proc hpgenselect; class A; model y/n = A x / dist=binomial; restrict A 1 0 -1; restrict x 2 >= 0.5; run;