Here is my regression model:
options(digits = 4) fit <- lm(reg_formula(), data = mtcars) b <- coef(fit) summary(fit)
The fitting result is $mpg = r b[1]
+ r b[2]``r input$x
$.
Below is a scatter plot with the regression line.
par(mar = c(4, 4, 1, 1)) plot(reg_formula(), data = mtcars, pch = 19, col = "gray") abline(fit, col = "red", lwd = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.