library(DT)

x <- "disp"
y <- "mpg"

mod <- lm(mpg ~ disp, data = mtcars)

The graph below displays the relationship between r y and r x in a data set of r nrow(mtcars) observations.

plot(mtcars[[x]], mtcars[[y]], xlab = x, ylab = y)

Based on a linear model, we predict that the expected value of r y will increase by r coef(mod)[[2]] units for each one unit increase in r x.

The raw data is available to explore here:

datatable(mtcars)


rstudio/reportsWS documentation built on May 28, 2019, 5:42 a.m.