1

I have found an interaction effect between the predictors age and education level in a multiple regression model assessing the effects of various predictors on alcohol consumption. I wish to graph this interaction effect using ggplot, but an alternative will do.

I have attempted to do it this way:

p <- ggplot(DataFrame, aes(ED,AGE, label=interaction-effect))

p <- p + geom_point(colour= "red")+geom_text(size=3) # colour = colr does not work 

p

This is continuously spouting errors. I cannot seem to find a way to simply make this plot and would greatly appreciate help.

1
  • 3
    I would provide some data, or use the mtcars dataset. For more info, take a look at this question. The better the question is, the faster and more precise the answer will be. Commented Jan 21, 2014 at 3:55

1 Answer 1

1

A straight-forward google search yields fairly good results:

http://www.r-bloggers.com/visual-interpretation-of-interaction-terms-in-linear-models-with-ggplot-rstats/

Interaction Plot in ggplot2

https://stats.stackexchange.com/questions/9477/how-to-draw-an-interaction-plot-with-confidence-intervals

http://www.cookbook-r.com/Graphs/Plotting_means_and_error_bars_(ggplot2)/#error-bars-for-within-subjects-variables

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.