FILENAME website HTTP 'http://www.public.asu.edu/~rgcox2/ECN410/data/bodyfat.xlsx'; data file; n=-1; infile website recfm=s nbyte=n length=len; input; file "bodyfat.xlsx" recfm=n; put _infile_ $varying32767. len; run; /* The data are from Kutner et al Table 7.1 and available from http://www.stat.ufl.edu/~rrandles/sta4210/Rclassnotes/data/textdatasets/KutnerData/Chapter%20%207%20Data%20Sets/CH07TA01.txt The sample is of "20 healthy females 25-34 years old" (page 256). BODYFAT : amount of body fat TRICEPS : triceps skinfold thickness THIGH : thigh circumference MIDARM : midarm circumference */ PROC IMPORT OUT= WORK.bodyfat DATAFILE= "bodyfat.xlsx" DBMS=xlsx REPLACE; *RANGE="A3:G80"; /*sheet="NEMA"*/ getnames=yes; RUN; proc means data=bodyfat; run; proc reg data=bodyfat; model bodyfat = TRICEPS THIGH MIDARM/ vif collin; /* the VIF and COLLIN options provide measures for diagnosing multicollinearity*/ 'thigh and midarm': TEST THIGH=MIDARM=0; run; QUIT; /* model selection procedures */ filename webtxt URL "http://www1.aucegypt.edu/faculty/hadi/RABE5/Data5/P060.txt"; DATA supervisor ; INFILE webtxt dsd delimiter=' ' firstobs=2; input Y X1 X2 X3 X4 X5 X6 ; run; proc print data=supervisor; run; /* Data are from Chatterjee and Hadi, see url above Y: overall rating X1: handles employee complaints X2: does not allow special priveleges X3: opportunity to learn new things X4: raises based on performance X5: too critical of poor performance X6: rate of advancing to better jobs */ proc reg data=supervisor; model Y= X1 X2 X3 X4 X5 X6/ selection=stepwise slentry=.2 slstay=.2 ; /* stepwsie selection */ run; QUIT; proc reg data=supervisor; model Y= X1 X2 X3 X4 X5 X6/ selection=forward slentry=.1; run; QUIT; proc reg data=supervisor; model Y= X1 X2 X3 X4 X5 X6/ selection=backward slstay=.2; run; QUIT; /* run a regression using a model selection procedure, minimize Mallow's Cp */ proc glmselect data=supervisor; model Y = X1 X2 X3 X4 X5 X6/select=cp; run; quit; /* run a regression using a model selection procedure, maximize adj R^2 */ proc glmselect data=supervisor; model Y = X1 X2 X3 X4 X5 X6/select=adjrsq; run; quit; /* run a regression using a model selection procedure, minimize AIC */ proc glmselect data=supervisor; model Y = X1 X2 X3 X4 X5 X6/select=aic; run; quit; /* learn more about the model selection options in SAS from the SAS documentation at: https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_reg_sect030.htm */