library(procs)
# Turn off printing for CRAN checks
# Set to TRUE to run in local environment
options("procs.print" = FALSE)
# Example 1: Regression statistics with default plots
res <- proc_reg(iris, model = "Sepal.Length = Petal.Length",
output = report,
plots = TRUE,
titles = "Iris Regression Statistics")
# View results
res
# Example 2: Regression statistics with custom plot request and by variable
res <- proc_reg(iris, model = "Sepal.Length = Petal.Length",
output = report,
by = Species,
plots = regplot(type = v(residualhistogram,
rstudentbypredicted, rstudentbyleverage),
label = TRUE),
titles = "Iris Regression Statistics")
# View results
res
# Example 3: Regression statistics with multiple models, same plot string
res <- proc_reg(iris, model = c("Sepal.Length = Petal.Length",
"Sepal.Length = Sepal.Width",
"Sepal.Length = Petal.Width"),
output = report,
plots = "diagnostics",
titles = "Iris Regression Statistics")
# View results
res
# Example 4: Regression statistics with multiple models, different plot strings
res <- proc_reg(iris, model = c("Sepal.Length = Petal.Length",
"Sepal.Length = Sepal.Width",
"Sepal.Length = Petal.Width"),
output = report,
plots = list("diagnostics",
"residualhistogram",
"fitplot"),
titles = "Iris Regression Statistics")
# View results
res
# Example 5: Regression statistics with multiple models, different plot functions
res <- proc_reg(iris, model = c("Sepal.Length = Petal.Length",
"Sepal.Length = Sepal.Width",
"Sepal.Length = Petal.Width"),
output = report,
plots = list(regplot(type = "diagnostics"),
regplot(type = "cooksd",
label = TRUE),
regplot(type = "fitplot",
stats = c("nobs", "mse", "rsquare"))),
titles = "Iris Regression Statistics")
# View results
res
# Example 6: Regression statistics with multiple models, influence charts
res <- proc_reg(iris, model = c("Sepal.Length = Petal.Length",
"Sepal.Length = Petal.Length Petal.Width",
"Sepal.Length = Petal.Length Petal.Width Sepal.Width"),
output = report,
plots = regplot(v(cooksd, dffits, dfbetas), label = TRUE),
titles = "Iris Regression Statistics")
# View results
res
Run the code above in your browser using DataLab