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.
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; run; 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. */
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.
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.