qacReg.Rmd
library(qacReg)
The qacReg package provide functions that offer a simple workflow for fitting and evaluating multiple linear or logistic regression models.
Actual model fitting is usually an iterative approach. However, the functions in the table below will help you to approach the process in a more structured fashion.
Function | Description |
---|---|
regress(formula, data) | Fits a multiple linear or a logistic regression model, depending on the number of unique values in the response variable. |
info(model) |
For a linear model, prints an overall summary, fit indices (R2, adj-R2, RMSE, MSE), omnibus F test, ANOVA table (type III SS), and a regression coefficients table that includes raw and standardized coefficients, SEs, t-tests, and p-values. For a logistic regression model, this prints an overall summary, omnibus chi-square test, fit measures (Stukel’s GOF test, Tjur’s Pseudo R2), ANOVA table (type III SS), regression coefficients (raw coefficients, SEs, z-values, p-values), and odds rations with 95% confidence intervals. |
diagnostics(model) |
For a linear model, creates plots to evaluate the normality of the residuals, linearity between predictors and response variable, homogeneity of variance, multicolinearity, outliers, and influential observations. For a logistic regression model, it creates plots to evaluate linearity between predictors and log-odds of the binary outcome, as well as multicolinearity, outliers, and influential observations. |
me_plots(model) | Generates one or more marginal effects graphs displaying the relationship between each predictor and the outcome, controlling for the other predictors in the model |
relimp(model) | Applies Dominance Analysis (DA) to rank order the variables in a linear or logistic regression in terms of relative importance. |
performance(model) |
Provides indices of predictive performance for linear and logistic regression models. The statistics can be calculated for the training or test data set. For linear regression, RMSE, MEA, and Rsquare are provided. For logistic regression output includes a confustion matrix and category based statistics (such as sensitivity, specificity, etc.). A visualization of the results is also provided. |
Function | Description |
---|---|
forest_plot(model) | Display a forest plot of regression parameters for a linear model or odds rations for a logistic regression model. |
roc_plot(actual, prob) | Plot a receiver operating characteristic curve for a binary predictive model. |
lift_plot(actual, prob) | Creates lift and gain charts for binary classification problems. |
See the Vignettes and Reference sections for examples.