BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
JacAder
Obsidian | Level 7

I am running the regression y = a + b*x, by ID, with the restriction of a=0 and b>0. 

In the PROC NLIN, the bounds statement requires inequality, so my code does not work.

1) if I simply set model = b*x (and delete a=0 in parameters and bounds statements), does that yield the result of a=0? seems like the result is desired, but I am not sure.

2) in the output dataset aa, _TYPE_ = "FINAL" are the estimated parameters, am I right?

Thank you and have a great holiday!

 

proc nlin data=sample outest=aa noprint;
   parameters a=0 b=1;         
   bounds  a=0, b>0;
   model y = a + b*x;
   by id;
   output out=bb  r=resid  parms=a b;
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @JacAder,

 


@JacAder wrote:

Also, in the output dataset aa, _TYPE_ = "FINAL" are the estimated parameters, am I right?


Yes, the observation with _TYPE_="FINAL" would contain the final parameter estimates.

 

If parameter a is known to be zero, I would just simplify the model equation to y = b*x and not mention a anywhere in the step. Since y = b*x is a linear model (without an intercept), I would start with PROC REG or PROC GLM and use the NOINT option of the MODEL statement. If the estimated slope b is positive, the restriction is met. Otherwise, given that there are reasons to expect a positive slope, I would suspect one or more outliers to distort the estimation. I don't think that PROC NLIN with its BOUNDS statement would really help in this situation: The outliers would mislead PROC NLIN's algorithms as well and I would expect a poor model fit with an estimate of b close to zero. I'd rather investigate the suspected outliers (scatter plot, ...) and consider robust regression (PROC ROBUSTREG) to deal with them.

 

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hi @JacAder,

 


@JacAder wrote:

Also, in the output dataset aa, _TYPE_ = "FINAL" are the estimated parameters, am I right?


Yes, the observation with _TYPE_="FINAL" would contain the final parameter estimates.

 

If parameter a is known to be zero, I would just simplify the model equation to y = b*x and not mention a anywhere in the step. Since y = b*x is a linear model (without an intercept), I would start with PROC REG or PROC GLM and use the NOINT option of the MODEL statement. If the estimated slope b is positive, the restriction is met. Otherwise, given that there are reasons to expect a positive slope, I would suspect one or more outliers to distort the estimation. I don't think that PROC NLIN with its BOUNDS statement would really help in this situation: The outliers would mislead PROC NLIN's algorithms as well and I would expect a poor model fit with an estimate of b close to zero. I'd rather investigate the suspected outliers (scatter plot, ...) and consider robust regression (PROC ROBUSTREG) to deal with them.

 

JacAder
Obsidian | Level 7
Really appreciate your help!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 503 views
  • 0 likes
  • 2 in conversation