Programming the statistical procedures from SAS

PROC GLM vs. PROC REG with categorical predictor

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

PROC GLM vs. PROC REG with categorical predictor

I confused between PROC GLM and REG, I read about the difference but still don't have the ability to answer a question like:

 

Q: A linear model has the following characteristics:
- A dependent variable (y)
- Three continuous predictor variables (x1-x3)
- One categorical predictor variable (c1with 3 levels)

Which SAS program fits this model?

 

240-Q49

 

My answer is C, but I the right answer is D. Why?

 

 


Accepted Solutions
Solution
‎02-24-2018 10:30 AM
PROC Star
Posts: 1,283

Re: PROC GLM vs. PROC REG with categorical predictor

Because, as you can see from the Syntax page of the PROC REG Documentation, PROC REG does not support a class statement.

View solution in original post


All Replies
Solution
‎02-24-2018 10:30 AM
PROC Star
Posts: 1,283

Re: PROC GLM vs. PROC REG with categorical predictor

Because, as you can see from the Syntax page of the PROC REG Documentation, PROC REG does not support a class statement.

New Contributor
Posts: 3

Re: PROC GLM vs. PROC REG with categorical predictor

Thank you, Understood now, I should explicitly create a dummy variable for categorical predictor before applying PROC REG.
Respected Advisor
Posts: 3,003

Re: PROC GLM vs. PROC REG with categorical predictor


tam_el wrote:
Thank you, Understood now, I should explicitly create a dummy variable for categorical predictor before applying PROC REG.

No.

 

You should use PROC GLM. Much simpler, you do not have to create dummy variables when you use PROC GLM, and you get the exact same answer as if you created the dummy variable and then ran PROC REG.

--
Paige Miller
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 203 views
  • 0 likes
  • 3 in conversation