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

Hello,

 

I am analyzing data where the dependent variable is categorical, and independent variables are continuous or categorical. What would be the best way to compare and generate a p-value? I was thinking proc ANOVA, but not quite sure.

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

Assuming that you have a categorical predictor variable and you want to estimate and compare the response (on the mean scale) among its levels then you can use the NLMeans macro. When the response is binary, this is the risk difference and this note illustrates how to do it. Another option is to estimate the difference in predictive margins for the predictor using the Margins macro which is also shown in that note. If the predictor is continuous, then you can estimate the change in the response mean for some amount of change in the predictor. This is the average marginal effect of the predictor and it can be estimated by the Margins macro as shown in this note. You would definitely not use PROC ANOVA which assumes that the response is continuous and approximately normally distributed.

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

@aw016 wrote:

 

I am analyzing data where the dependent variable is continuous, and independent variables are continuous or categorical. What would be the best way to compare and generate a p-value? I was thinking proc ANOVA, but not quite sure.


Okay, let's stop here. Your title ("dependent variable is categorical") and your first sentence ("dependent variable is continuous") contradict each other. So, please clarify.

--
Paige Miller
aw016
Obsidian | Level 7

Hi, 

thanks for reminding me! It's a typo, I have edited the question. I meant categorical.

StatDave
SAS Super FREQ

Assuming that you have a categorical predictor variable and you want to estimate and compare the response (on the mean scale) among its levels then you can use the NLMeans macro. When the response is binary, this is the risk difference and this note illustrates how to do it. Another option is to estimate the difference in predictive margins for the predictor using the Margins macro which is also shown in that note. If the predictor is continuous, then you can estimate the change in the response mean for some amount of change in the predictor. This is the average marginal effect of the predictor and it can be estimated by the Margins macro as shown in this note. You would definitely not use PROC ANOVA which assumes that the response is continuous and approximately normally distributed.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 538 views
  • 2 likes
  • 3 in conversation