[R] Visreg package : Legend to large and 3 ways-interactions possible ?

varin sacha v@rin@@ch@ @ending from y@hoo@fr
Sat Jan 12 15:22:41 CET 2019


Dear R-experts,

The reproducible example is below.

I am trying to use the visreg package for 2 ways-interactions and for 3 ways-interactions.
For 2 ways-interactions, everything goes fine except that the legend on the top (2.HS Grad ; 3. Some College ; 4. College Grad) is not entire/complete, because written too large, I would like to make it smaller to be able to read the entire legend. Is it possible ?

My 2nd question: I am wondering if it is possible to plot 3 ways-interactions using visreg : "year" ; "age"; "education" ?

Many thanks for your time

############# 

install.packages("ISLR")

library(ISLR)

install.packages("visreg")

library(visreg)

install.packages("mgcv")

library(mgcv)

mod1<-gam(wage ~education+s(age,bs="ps")+year+te(age,year,bs="ps")+s(year,bs="ps",by=education,m=1)+te(year,age,by=education,bs=rep("ps",2)),data=Wage)

visreg(mod1, "year", by="education",partial=FALSE,overlay=TRUE)

 ############# 
 



More information about the R-help mailing list