Skip to content
Prev 378068 / 398502 Next

mgcv : 3-way interaction and 3D-plots ?

On 1/7/19 3:35 PM, varin sacha via R-help wrote:
Forget ggplot2. It has ignored this sort of visualization effort. Use 
lattice or base plotting methods.


In order to plot a 2way interaction one needs a pseudo-3way plot 
(`wireframe`) or a single `levelplot`. For display of a 3way interaction 
in lattice (given the human minds inability to "see" in 4 dimensions) 
you will need to specify levels for one of the variables to display 
slices perhaps using multiple displays of 2way "sub-interactions" 
calculated ad meaningul levels of the variable you choose to slive 
with.? I'm not sure what the "native" plotting method for pkg:mgcv might 
be. I suspect it was base graphics,; if so, look at ?persp and ?contour.