1

I'm trying to compare two multivariate multiple regression models in R (see here)

When I use AIC() or BIC(), R says it does not allow multiple responses.

Is there a way to get a single AIC/BIC or r^2 for a multivariate multiple regression model (or is it mathematically unsound to do it for multiple responses)?

merv
  • 67,214
  • 13
  • 180
  • 245
RandomMonitor
  • 439
  • 1
  • 8
  • 16

1 Answers1

1

Check out ?AIC, for example

AIC(lm(Sepal.Width ~ Sepal.Length + Species,data=iris))

AIC/BIC for multiple responses is not meaningfull AFAIK.

  • Thanks, but can you elaborate on "not meaningful"? Do you know if there is another way to compare the models? – RandomMonitor Jul 13 '15 at 14:17
  • 1
    [previous edit took too long] Each predicted variable would have it's own AIC/BIC in a multivariate model. Model selection therefore yields a multi-purpose optimisation. The way to handle that would be to somehow compbine the individual AIC's to a single penalty function. You can e.g. add the AIC's for the two or more predicted variables, but as their value also depends on the scale of the predicted variable some kind of weighted sum is probably appropriate. –  Jul 13 '15 at 20:13
  • My models are nested, so that M2 uses the same variables as M1 plus one more predictor variable (which is measured on the same scale as the predictor variable already in M1), so I'd think there are no need for weighting. But yeah, thinking and doing some tests made it obvious that using AICs like this would not work (as the models are nested, AIC of M2 is always bigger than M1). However, I'm wondering whether it would be possible to calculate a "sum AIC" on my own, adding together sums of squares from all outcomes and penalizing them via AIC formula only once. What do you think? – RandomMonitor Jul 14 '15 at 09:59
  • Well, if the number of predictors, and hence the number of models you want to test is fairly limited, the easiest would be to just brute-force it. Compute all the models, compute all their AIC/BIC's and then select the one with the most desirable properties. –  Jul 14 '15 at 15:40
  • You can generate formulas from text vectors using as.formula. For example: vars <- c("y", "z"); forms <- as.formula(paste("x ~",vars)); M <- lapply(forms, lm, data=) –  Jul 14 '15 at 15:43