# Alternatives to three-way ANOVA with unbalanced and non-idependent data, non-normal distribution of the residuals and heterocedasticity

I have a response variable ("Value") and three categorical variables for which I want to test the main effects and interactions. ALL DATA COMES FROM ONE INDIVIDUAL for which we have data over time. The factors I want to test their effects upon my response variable are:

1) Formula. I can use different formulas to create my response variable. Levels: "Form1" and "Form2"

2) Time Interval. I split all data (3 days of continuous data) in different "Time intervals" for which I calculate (using either Form1 or Form2) my response variable. Levels: "5s", "30s" and "60s"

3) Behaviour: my individual did two defined behaviours all, and I know for each time interval which behaviour was. Levels: "Regular" and "Irregular"

I want to prove that one of the formulas (Form1) used for creating this response variable is not consistent among different time windows nor behaviours. That is when you use "Form1" the estimation of the response variable depends on the time interval and the behaviour. On the other hand, "Form2" is consistent among time intervals and behaviours. I attach an interaction plot with standard errors ("Plot1") where you can see what I am trying to explain.

I thought to use a "Three-way ANOVA" to test this. However, when I reviewed residual plots to check to whether my data meet the assumptions for an ANOVA, I found that they don't. Below I show the code and the diagnosis plots from the model:

model  <- lm(Value ~ Behaviour*Formula*Time.Interval, data = ValidationFormula)
par(mfrow=c(2,2))
plot(model)


I guess the histograms and boxplots below give some ideas about what is happening.

What can I do to analyze the main effect in Value of Time.Interval, Formula and Behaviour, and their interaction taking into account that data are 1) unbalanced, 2) non-normal and 3) heteroscedastic? I guess my data are not independent either since I divide time into different Time Intervals and, among other things, I am comparing the effect of dividing time into different time intervals.