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!
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.
@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.
Hi,
thanks for reminding me! It's a typo, I have edited the question. I meant categorical.
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.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.