BookmarkSubscribeRSS Feed
Quartz | Level 8

Hello everyone,
I have been using proc reg with backward selection and noticed some discrepancies in my results. I ran the same independent variable in the last step of backward selection and obtained different output. Below, I have included the code and the results. Can someone please explain which output is correct? Thank you.



Compared to the below procedure.











Diamond | Level 26

I would conclude from your screen captures that the data set ch6EG.time_series has changed between the two runs. This is apparent because the Corrected Total SS is not the same in the two runs.

Paige Miller
Quartz | Level 8
Thank You
Jade | Level 19

Hello @Golf,


It looks like your first model used only 44 observations of the input dataset ch6EG.time_series, whereas the second model used 46 (see column "DF", row "Corrected Total" in the "Analysis of Variance" table or "Number of Observations Used" in the part of the output not shown). The difference is due to two observations having at least one missing value in the variables that have been eliminated in the process of backward selection.


I would prefer the second model because it doesn't seem useful to exclude observations due to missing values in variables that are not used in the model anyway.


Here is a similar example using the SASHELP.CLASS dataset:

data class;
set sashelp.class;
if mod(_n_,3) then x=age;

proc reg data=class;
model weight=height x / selection=backward;
quit; /* --> 13 observations used, variable x was removed, leaving Intercept and Height. */

proc reg data=class;
model weight=height;
quit; /* --> Same model, but all 19 observations used, hence different statistics. */
Quartz | Level 8

@FreelanceReinh  Thank You.



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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg



Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1 like
  • 3 in conversation