I am trying to build a stepwise regression model using debt as the dependent variable, and all of the other variables in the data file as a predictor variables.
Here is the data:
/* --------------------------------------------------------------------
Code generated by a SAS task
Generated on Tuesday, March 22, 2022 at 6:55:23 PM
By task: Import Data Wizard
Source file: P:\MS_3313\Exam_1\GDP.xlsx
Server: Local
Output data: WORK.GDP
Server: Local
-------------------------------------------------------------------- */
/* --------------------------------------------------------------------
This DATA step reads the data values from a temporary text file
created by the Import Data wizard. The values within the temporary
text file were extracted from the Excel source file.
-------------------------------------------------------------------- */
DATA WORK.GDP;
LENGTH
Year 8
GDP 8
Budget 8
Surplus 8
'Relative Surplus'n 8
Debt 8
Interest 8
'Relative Interest'n 8 ;
FORMAT
Year BEST12.
GDP BEST12.
Budget BEST12.
Surplus BEST12.
'Relative Surplus'n BEST12.
Debt BEST12.
Interest BEST12.
'Relative Interest'n BEST12. ;
INFORMAT
Year BEST12.
GDP BEST12.
Budget BEST12.
Surplus BEST12.
'Relative Surplus'n BEST12.
Debt BEST12.
Interest BEST12.
'Relative Interest'n BEST12. ;
INFILE 'C:\Users\ssd506\AppData\Roaming\SAS\EnterpriseGuide\EGTEMP\SEG-3756-4b181ba3\contents\GDP-d0419501d7d1440499323245eac8b347.txt'
LRECL=36
ENCODING="WLATIN1"
TERMSTR=CRLF
DLM='7F'x
MISSOVER
DSD ;
INPUT
Year : BEST32.
GDP : BEST32.
Budget : BEST32.
Surplus : BEST32.
'Relative Surplus'n : BEST32.
Debt : BEST32.
Interest : BEST32.
'Relative Interest'n : BEST32. ;
RUN;Here is my code:
proc contents varnum data=work.gdp; ods select position; run; proc glmselect data=work.gdp plots=all; class Debt Budget GDP Budget Interest 'Relative Interest'n 'Relative Surplus'n Surplus Year; model Debt = Budget GDP Budget Interest 'Relative Interest'n 'Relative Surplus'n Surplus Year / details=all stats=all selection=stepwise; run; ods graphics off;
The MODELAVERAGE statement has an Alpha= option and default is Alpha=0.5. So may investigate that statement.
The MODELAVERAGE statement has an Alpha= option and default is Alpha=0.5. So may investigate that statement.
Thanks you!
Does this look correct?
proc contents varnum data=work.gdp;
ods select position;
run;
proc glmselect data=work.gdp plots=all;
modelaverage alpha=0.5;
class Debt Budget GDP Budget Interest 'Relative Interest'n 'Relative Surplus'n Surplus Year;
model Debt = Budget GDP Budget Interest 'Relative Interest'n 'Relative Surplus'n Surplus Year
/ details=all stats=all selection=stepwise;
run;
ods graphics off;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.