knitr::opts_chunk$set( error = TRUE, collapse = TRUE, comment = "#>", out.width = "100%" )
library(testthat) library(jeksterslabRplots)
model <- lm( wages ~ gender + race + union + education + experience, data = jeksterslabRdatarepo::wages ) yhat <- as.vector(predict(model)) epsilonhat <- as.vector(residuals(model)) tepsilonhat <- as.vector(rstudent(model)) h <- as.vector(hatvalues(model))
.residual.plot( yhat = yhat, tepsilonhat = tepsilonhat, epsilonhat = epsilonhat, h = h )
expect_error( object = .residual.plot( yhat = yhat, tepsilonhat = tepsilonhat, epsilonhat = epsilonhat, h = h ), regexp = NA )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.