I have a model in R that includes a significant three-way interaction between two continuous independent variables IVContinuousA, IVContinuousB, IVCategorical and one categorical variable (with two levels: Control and Treatment). The dependent variable is continuous (DV).
model<-lm(DV ~ IVContinuousA * IVContinuousB * IVCategorical)
You can find the data here
I am trying to find out a way to visualise this in R to ease my interpretation of it (perhaps in ggplot2?).
I thought that I could dichotomise IVContinuousB into high and low values (so it would be a two-level factor itself: IVContinuousBHigh = mean of IVContinuousB + sd of IVContinuousB; IVContinuousBLow = mean of IVContinuousB - sd of IVContinuousB).
I then planned to plot the relationship between DV and IV ContinuousA and fit lines representing the slopes of this relationship for different combinations of IVCategorical and my new dichotomised IVContinuousB:
IVCategoricalControl and IVContinuousBHigh IVCategoricalControl and IVContinuousBLow IVCategoricalTreatment and IVContinuousBHigh IVCategoricalTreatment and IVContinuousBLow
My first question is - does this sound like a viable solution to producing an interpretable plot of this three-way-interaction? I want to avoid 3D plots if possible as I don't find them intuitive.
Secondly - does anyone have any idea on how to code for this in R via ggplot2? I appreciate this latter question may be more apt for Stack Overflow but given the problem I have is primarily a methodological one I thought I'd post it on Cross Validated as a primary choice - hope this is ok.
Thank you very much in advance for your thoughts.
Note that there are NAs (left as blanks) in the DV column and the design is unbalanced - with slightly different numbers of datapoints in the Control vs Treatment groups of the variable IVCategorical.