Example of a three-way interaction plot in R Is this an example of interaction plot?
However, in the bottom of the article it is wrtitten, that it's not a 3-way-interaction (link to article). How should I understooth it? If it's not a 3-way-interaction plot then how can it been done in R?
library(MASS)
library(effects)

wvs.2 <- polr(poverty ~ country*(gender + religion + degree + ns(age, 4)),data = WVS)  

plot(Effect(focal.predictors = c("country","age","gender"), mod = wvs.2, xlevels = list(age = 20:80), latent = TRUE), rug = FALSE, ylim = c(0,3.5))  


Edited - new question:
WHat does ns(, 4) exactly do? I know that if we didn't use this the the lines will be linear but I just didn't understooth what it exactly does. Is it similar to something like agea^2? Or boes ns(age, 4) for instance take the 4th number for age and then plot and that's why it's curved instead of linear? in the paper by John fox they use bs(, 4) instead. It does the same. I know that it is explained in the article and in the paper by JOhn FOx but I didn't understooth their explanation.
EDIT 2
The summary of the estimated model shows interactions between countryage and countrygender which are the 3 variables plotted in the picture above. My question is then is the plot actually a plot/visualization of 2 different interactions? 1 for countryage and 1 for countrygender?
I'm asking because I have to write about a similar plot with different data and variables etc. But I used the same method, however I'm in doubt about what I should write. Is it a two-way interaction with the effect of gender added or is it 2 different 2-way interaction plots combined in multiple plots?
> Anova(wvs.1)
Analysis of Deviance Table (Type II tests)

Response: poverty
                 LR Chisq Df Pr(>Chisq)    
country           250.881  3  < 2.2e-16 ***
gender             10.749  1  0.0010435 ** 
religion            4.132  1  0.0420698 *  
degree              4.284  1  0.0384725 *  
age                49.950  1  1.577e-12 ***
country:gender      3.049  3  0.3841657    
country:religion   21.143  3  9.833e-05 ***
country:degree     12.861  3  0.0049476 ** 
country:age        17.529  3  0.0005501 ***


This is not an interaction plot in the strict sense of the term. An interaction plot has a single plot and multiple lines. The horizontal axis shows a predictor (categorical or continuous), the vertical axis is a response, and the multiple fitted lines show how the fitted response depends on the predictor, where each line corresponds to one level of a grouping factor. Take a look at the figure in the Wikipedia article: the horizontal axis is education level, the vertical axis is proclivity to care about sea level rise, and the grouping factor is political stance with three levels, thus we get three lines.
Your plot is paneled. It does show (or can show) a three-way interaction, simply not in a single plot, but in eight plots, because you have one continuous predictor (age, on the horizontal axis) and two categorical predictors (gender in rows and countries in columns). This is a very good representation, which allows us to see how the response-age relationship varies by country and gender.
Your confusion stems from the fact that this could show a three-way interaction, but in this particular case, no three-way interaction was modeled. The model included a two-way interaction between country and age and an additional main effect of gender. Thus, the curves differ between countries (that's the country-age interaction), but they have the same shape between genders within each country, they are just shifted up or down between the genders (that's the main effect of gender). If the model hadn't included gender at all, then you could of course still create a plot like this, but then both rows would be identical, because there would be no fitted difference between genders.
