- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
thanks for reminding me! It's a typo, I have edited the question. I meant categorical.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.