How would you fit a linear model over a scatter-plot?
Answer Posted / Omveer Singh
"To fit a linear model over a scatter plot in R, use the lm() function. This function calculates the coefficients of the best fitting line.nnExample:n```Rnx <- c(1, 2, 3, 4, 5)ny <- c(2, 4, 6, 8, 10)nlm_fit <- lm(y ~ x)nsummary(lm_fit)n```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers