BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LABRADOR
Obsidian | Level 7

 

Hello SAS Community, 

I was able to get the correct answer for this question using SAS Enterprise Guide; However, I'd like to know how this can be done through code rather than the point-and-click method. Could someone please tell me how to find R-squared for the final model?  

_______________________________________________________________________________________________________________________________

Using x22 as the dependent variable and x7 to x21 as predictor variables using stepwise regression with a .05 enter level and .05 leave level, what is the R-squared for the final model?

x7x21x22
3.98.465.1
2.77.567.1
3.4972.1
3.37.240.1
3.4957.1
2.86.150.1
3.77.241.1
3.37.756.1
3.68.256.1
4.56.759.1
3.28.468.1
4.96.653.1
5.67.958.1
3.98.272.1
4.57.662.1
3.27.171.1
47.250.1
4.18.258.1
3.47.955.1
4.58.867.1
3.8750.1
5.79.970.1
3.68.160.1
2.4865.1
4.15.555.1
3.6758.1
3770.1
3.35.655.1
37.270.1
3.66.252.1
3.47.144.1
2.56.251.1
3.77.644.1
3.3962.1
46.754.1
3.27.151.1
3.47.257.1
4.19.977.1
3.67.665.1
4.95.853.1
3.48.461.1
3.87.961.1
5.17.672.1
5.18.455.1
2.56.565.1
4.17.758.1
4.3867.1
3.87.160.1
3.78.567.1
3.97.661.1
3.67.248.1
2.78.267.1
2.5966.1
3.47.244.1
3.38.162.1
3.88.959.1
5.18.874.1
3.67.558.1
4.3767.1
2.88.561.1
3.27.271.1
3.88.863.1
3.9844.1
2.28.147.1
3.67.148.1
3.8960.1
46.250.1
3.78.248.1
3.55.851.1
3.6858.1
4.57.767.1
3.2743.1
4.37.966.1
3.79.866.1
3.98.465.1
38.963.1
3.67.549.1
3.8861.1
3.58.172.1
3.47.644.1
38.863.1
3.2868.1
2.98.553.1
3.26.537.1
2.67.752.1
3.57.251.1
3.6648.1
2.68.252.1
3.67.459.1
5.59.359.1
3.77.958.1
4.26.551.1
3.98.672.1
3.58.972.1
3.88.459.1
4.88.150.1
3.47.248.1
3.27.751.1
4.97.461.1
3757.1
3.66.152.1
57.171.1
4.77.659.1
5.6958.1
4.38.966.1
3.47.561.1
4.19.377.1
4862.1
3.77.661.1
3.27.143.1
58.166.1
3.57.969.1
3.67.265.1
4.37.765.1
3.87.963.1
4.76.959.1
59.571.1
3.67.546.1
4.1845.1
2.57.151.1
5.18.874.1
3857.1
2.27.747.1
2.58.266.1
4.36.552.1
3.78.154.1
3.98.161.1
3.66.946.1
5.79.370.1
2.86.247.1
3.6860.1
2.57.165.1
3.26.537.1
3.87.153.1
2.58.251.1
4.1775.1
2.86.747.1
4.97.561.1
4.27.451.1
3.67.449.1
3.47.955.1
2.8861.1
3.4872.1
3.88.472.1
4.28.866.1
4.27.966.1
3.8653.1
3.78.258.1
5.18.455.1
4.17.455.1
4.3865.1
3.36.656.1
4.37.652.1
3.57.569.1
5.17.155.1
2.87.961.1
3.67.648.1
3.47.148.1
3.77.648.1
3.68.259.1
3.76.944.1
4.58.162.1
3.77.654.1
3.68.453.1
3.67.453.1
4.17.945.1
3.47.244.1
3.77.641.1
2.96.753.1
47.454.1
3.36.255.1
2.67.559.1
3.77.466.1
4.87.950.1
5.16.555.1
3.78.667.1
2.48.665.1
5866.1
2.68.159.1
5.78.270.1
2.57.251.1
4.18.475.1
5.79.470.1
5.19.472.1
2.87.561.1
3.86.672.1
2.84.350.1
3.66.648.1
3.67.456.1
3.77.161.1
3.96.744.1
4.56.759.1
3.67.248.1
3.87.150.1
3.3640.1
3.68.458.1
48.662.1
57.966.1
5.57.659.1
58.566.1
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Use PROC REG. There are examples at the link. Use SELECTION=STEPWISE in the model statement.

 

Also, I haven't used Enterprise Guide in a long time, but it should be able to provide you with the exact SAS code.

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

Use PROC REG. There are examples at the link. Use SELECTION=STEPWISE in the model statement.

 

Also, I haven't used Enterprise Guide in a long time, but it should be able to provide you with the exact SAS code.

--
Paige Miller
LABRADOR
Obsidian | Level 7

Thank you!

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 652 views
  • 1 like
  • 2 in conversation