I am investigating size changes over time. I have five size variables in a multivariate linear model against year. I used the Anova() function in the car package to test whether the slopes are equal for each size measures. Since they proved to be significantly different I wanted to run a pairwise test for each combination of the size measures (remember, these are the response variables) but I did not manage to figure out the way how to do it. So far my code is almost the same as the one below but instead of a categorical variable I have a numeric as an explanatory variable.
names(iris) <- c("SL", "SW", "PL", "PW", "SPP")
mod.iris <- lm(cbind(SL, SW, PL, PW) ~ SPP, data=iris)
summary(mod.iris)
manova.iris <- Anova(mod.iris)
summary(manova.iris)
So using this example I want to test whether the slopes of SL to SW, SL to PL, SL to PW etc. are significantly different or not, do so for each combination and (optionally) adjust p-values. I am seeking for some post hoc test for slopes in multivariate regression.
Thanks,
Gabor
The slopes (and intercepts) are contained in
mod.iris$coefficients
.For comparing the slope of SL to the one of SW, do:
and to compare the slope of SL to SW, do: