Reputation: 25
I was wondering how I can have this plots for multiple outputs. I want to have a plot () of each output in "a" separately.
b<- lapply(mtcars[-c(4,8,9)], function(x) lm(x ~ vs*am, data=mtcars))
a<- lapply(b,interactionMeans)
mtcars data set is available in R.
Upvotes: 1
Views: 34
Reputation: 24262
Maybe this is what you are looking for:
library(phia)
mtcars$vs <- factor(mtcars$vs)
mtcars$am <- factor(mtcars$am)
b <- lapply(mtcars[-c(4,8,9)], function(x) lm(x ~ vs*am, data=mtcars))
a <- lapply(b, interactionMeans)
tmp <- lapply(a, function(x) {windows(); plot(x)})
Upvotes: 1