Skip to content
Prev 369816 / 398503 Next

about fitting a regression line

Rather than just posting your error message, it helps immensely to post the
code that produced the error--indeed with some small sample data that
reproduces the problem.

x <- rnorm(40)
y <- 0.6 * x + rnorm(40, sd = 0.3)
plot(y ~ x)
model <- lm(y ~ cos(x))
summary(model)
plot(y ~ cos(x))
abline(model, col = "red")

## obviously I am not claiming that this is a meaningful or sensible model
## It's just for illustrative purposes

--Chris Ryan
On Thu, Jun 15, 2017 at 3:48 PM, lily li <chocold12 at gmail.com> wrote: