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

Hello !

I have a table with multiple categorical variables in input and a continuous variable in output. I ran a Proc glm on this table, which gives me coefficients for all the modalities. Now i'm trying to "apply" all those coefficients to my real observations and add a column "regression output" to my table that gives me the "predicted" output for every observation. So I can compare the real output and the predicted one. 

 

Thank you for your help 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
ed_sas_member
Meteorite | Level 14

Hi @Mathis1 

 

You can add the predicted option to the output statement:

proc glm data=have;
   class x1 x2 ...;
model y = x1 x2 ... / solution; output out=want predicted=predicted_varname; run;

Best,

View solution in original post

2 REPLIES 2
ed_sas_member
Meteorite | Level 14

Hi @Mathis1 

 

You can add the predicted option to the output statement:

proc glm data=have;
   class x1 x2 ...;
model y = x1 x2 ... / solution; output out=want predicted=predicted_varname; run;

Best,

PaigeMiller
Diamond | Level 26

Adding to the already correct solution ... you may want

 

output out=want predicted=predicted_varname residual=residual_varname;
--
Paige Miller

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 477 views
  • 0 likes
  • 3 in conversation