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
bounds 0 < a1 < a2 < a3 < 1;
y = a0 + a1*x1 + (a2-a1)*x2 + (a3-a2)*x3 + (1-a3)*x4;
In proc nlin, use bounds
bounds 0 < C < 1;
and equation
y = a + C x1 + (1-C) x2 + u;
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 ?
bounds 0 < a1 < a2 < a3 < 1;
y = a0 + a1*x1 + (a2-a1)*x2 + (a3-a2)*x3 + (1-a3)*x4;
proc hpgenselect; class A; model y/n = A x / dist=binomial; restrict A 1 0 -1; restrict x 2 >= 0.5; run;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.