R print equation of linear regression on the plot itself
问题 How do we print the equation of a line on a plot? I have 2 independent variables and would like an equation like this: y=mx1+bx2+c where x1=cost, x2 =targeting I can plot the best fit line but how do i print the equation on the plot? Maybe i cant print the 2 independent variables in one equation but how do i do it for say y=mx1+c at least? Here is my code: fit=lm(Signups ~ cost + targeting) plot(cost, Signups, xlab="cost", ylab="Signups", main="Signups") abline(lm(Signups ~ cost)) 回答1: I