I want to plot an interaction in R, but I get a quite confusing plot that does not appear parsomonious at all.

The code I used to create it is:

interaction.plot(x.factor = mydata$cN, 
                 trace.factor = mydata$cDA,
                 response = mydata$tDep)

Could it maybe be a problem with graph scalling? What do you think it could be? How could I make the interpretation of this plot easier?

  • $\begingroup$ Using different colors for the different lines might help some. Also, getting rid of the lines and just using points (boxes or circles) where there is actual data might help. Putting fewer categories (those in the legend) might help. $\endgroup$ – Sal Mangiafico Nov 28 '17 at 15:05
  • 2
    $\begingroup$ Line charts on nonlinear axes (the x axis here) typically are meaningless or deceitful. This nonlinearity does suggest, though, that you are treating numerical variables cN and cDA as factors, thereby using $9\times 10-1=89$ parameters to model them (assuming you included the interactions). That's about as unparsimonious as you can get! Did you intend to do that? $\endgroup$ – whuber Nov 28 '17 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.