Add regression line (and goodness-of-fit stats) to scatterplot

后端 未结 1 1779
灰色年华
灰色年华 2021-01-17 01:10

After reviewing other stackoverflow posts, I am attempting to add a regression line to my scatter plot with:

plot(subdata2$PeakToGone, subdata2$NO3_AVG, xlim         


        
相关标签:
1条回答
  • 2021-01-17 01:38

    By default, plot regards the 1st param as x and the 2nd as y. Try

    plot(y = subdata2$PeakToGone, x = subdata2$NO3_AVG, xlim = c(0, 70))
    abline(lm(PeakToGone~NO3_AVG, data = subdata2))
    

    and look if the line is visible, now. You'll find an answer to your 2nd question here.

    0 讨论(0)
提交回复
热议问题