BookmarkSubscribeRSS Feed
AndrewBronson
Calcite | Level 5

I am looking to run a regression analysis but only get positive coefficients just based on the scenario of my calculation negative coefficients are nonsensical.  I am currently using PROC REG with a LSMEANS but I dont know if this is the only way to run it.  I have tried to use RESTRICT and BOUNDS but neither have worked. 

 

Thanks in advance

3 REPLIES 3
PaigeMiller
Diamond | Level 26

Well, here's the problem. If you have multiple X variables in your regression, and they are correlated with one another, you can get slopes that seem to have the wrong sign. This is a consequence of including variables that are correlated with one another.

 

You can try removing variables from the model, or use PROC PLS instead of PROC REG, which is less susceptible to this problem.

--
Paige Miller
AndrewBronson
Calcite | Level 5

Yes I figured the multicollinearity is likely a problem.  I will try the PROC PLS.  Thank you for the suggestion

stanmarciano
Fluorite | Level 6

If you have a very sound theoretical backing for your coefficients to be positive, then you could use bayesian regression method and set the prior distributions from positive distributions: 

 

Here are some helpful links for bayesian regression:

 

1) Basic setup of model using proc Genmod: https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_genmod_sect...

 

1a) How to change priors: 

https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_genmod_sect...

 

Alternatively (This might be the best proc to use in your case):

Proc MCMC is another possible solution:

3) Proc MCMC linear regression: https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_mcmc_sect00...

 

Here note that I am assuming that you have very solid theoretical backing for your Beta coefficients to be positive. This is a very strong assumption and has to be based on evidence from prior literature or some other source. 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 3 replies
  • 1839 views
  • 2 likes
  • 3 in conversation