0

I have the following example plot:enter image description here

Created via:

    q<-ggplot(data=all_summ,aes(x=Xvals, y=Yvals,color=ColorVals),size=2)+
      geom_point(size=2)+
      geom_smooth(method = "lm", fill = NA)+
      facet_grid(.~facets)

My question is: how can I compare the created lm() models? Typically I would just do:

lm_model1<-lm(...)
lm_model2<-lm(...)
anova(lm_model1,lm_model2)

Or something along these lines. Unfortunately I am unsure how to do this if all the models are created in ggplot2. Is there somewhere it stores all of these models so I can analyze them?

AMB
  • 129
  • 8
  • What do you mean by comparing the models? Are the models from different data-subset with the same independent and dependent variables? Are these multiple linear regression or just a simple regression? If it's a multiple linear regression, are the models plotted based on predicted values by holding the other independent variables constant at median value? – Adam Quek Aug 13 '19 at 03:50
  • 1
    Anyway, the question is not a stackoverflow question. You should ask this at CrossValidated instead. – Adam Quek Aug 13 '19 at 03:51
  • https://stackoverflow.com/questions/7005483/geom-smooth-what-are-the-methods-available – Tung Aug 13 '19 at 05:10

0 Answers0