I have the following model where X is the duration of a particular event, A is a factor with five levels and B is a factor with two levels. I want to run a type III ANOVA analysis.
type3.model1 <- list(A = contr.sum, B = contr.sum)
model1<-lm(X~A*B, data = X.duration, contrasts = type3.model1)
summary(model1)
Anova(model1, type = 3)
Examination of the diagnostic plots (see below) show that the assumption of normality of residuals (plot 2) is violated:
Neither log nor sqrt transformation of the dependent variable improved this violation (in both cases the p-value from a Shapiro-Wilk test decreased after transformation) so I wanted to use a Box-Cox transformation in order to identify lambda and thus the best way to transform the data. However, I have only been able to find code that does this in cases where there is only one dependent variable (as below):
library(MASS)
x1<-boxcox(model1)
To calculate lambda:
lambda.1<- model1$x[which.max(model1$X)] where x is the sole dependent variable.
Is there a way I can calculate lambda for a model with more than one dependent variable?

