BookmarkSubscribeRSS Feed
hellohere
Pyrite | Level 9

The link below give out Stepwise Regression. 

https://communities.sas.com/t5/SAS-Programming/How-to-do-Regression-on-Broken-Turning-Line/m-p/83226...

 

I have one quest. Say I have dataset below. Surely I can have code on two-step regression. But how to tell(what criteria to tell) two-step

is better than one-step regression?! Thanks, 

 

%let slope1=-2; %let slope2=5; %let turner=90;

data indata;
do i=1 to 100;
	if i<&turner. then y=5*ranuni(i)+i*&slope1.;
	else y=10*ranuni(i)+i*&slope2.-&turner.*&slope2.+&turner.*&slope1.;
	output;
end;
run;quit;

ods listing gpath="%sysfunc(getoption(work))";
proc sgplot data=indata;
scatter x=i y=y; 
run;quit;

SGPlot29.png

 

2 REPLIES 2
hellohere
Pyrite | Level 9

The dataset is hypo. What if turner=95 or turner=98?!

PaigeMiller
Diamond | Level 26

Duplicate post. An answer was discussed here. Please put all discussion of this problem in one location, at the link I gave.

--
Paige Miller

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

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