Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

R - comparing simple regression models that were run on several DVs

$
0
0

Say you have the following code in R:

model1 <- lm(cbind(DV1, DV2, DV3) ~ IV1 + IV2, data)

This code should perform separate regressions of IV1 + IV2 on DV1, then of IV1 + IV2 on DV2 and lastly, of IV1 + IV2 on DV3.

Say that we also have a model which includes interaction between IV1 and IV2:

model2 <- lm(cbind(DV1, DV2, DV3) ~ IV1 * IV2, data)

To test if there is an interaction, I would usually use:

anova(model1, model2)

However, this returns only one p-value, whereas I was expecting three p-values - one for DV1, one for DV2 and one for DV3. How can I achieve what I'm trying?


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>