knitr::opts_chunk$set( error = TRUE, collapse = TRUE, comment = "#>", out.width = "100%" )
# The Linear Regression Model (Plots) {#linreg-plots}
library(testthat) library(jeksterslabRlinreg)
In this example, we are interested in predictors of wages. The regressor variables are gender, race, union membership, education, and work experience. The regressand variable is hourly wage in US dollars.
See jeksterslabRdatarepo::wages.matrix()
for the data set used in this example.
X <- jeksterslabRdatarepo::wages.matrix[["X"]] # age is removed X <- X[, -ncol(X)] y <- jeksterslabRdatarepo::wages.matrix[["y"]] head(X) head(y)
scatter.plot( X = X, y = y )
residual.plot( X = X, y = y )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.