Regression - Diagnostic - Plot - Influence Index

From Q
Jump to navigation Jump to search


Charts the studentized residuals, hat values, and Cook's distances for the observations in a regression model. The observation numbers of the five highest values on each of the measures are charted.

Example

The below example shows the output from running this diagnostic on a Poisson regression model used to predict days absent from school for a sample of school children in New South Wales, Australia.

Details

Roughly, in a model with n samples and p predictors (including the intercept), studentized residuals larger than 2 indicate possible outliers, hat values larger than 2*p/n indicate possible high leverage values, and Cook's distance values larger than 4/(n-p) indicate possible highly influential observations.

Acknowledgements

Uses the influenceIndexPlot function from the car package.

References

Fox, J., & Sanford, W. (2011). An R Companion to Applied Regression, Second Edition. Thousand Oaks CA: Sage.

Weisberg, S. (2014). Applied Linear Regression, Fourth Edition. Wiley.

Code

var __webpack_modules__ = ({});
// The module cache
var __webpack_module_cache__ = {};

// The require function
function __webpack_require__(moduleId) {

// Check if module is in cache
var cachedModule = __webpack_module_cache__[moduleId];
if (cachedModule !== undefined) {
return cachedModule.exports;
}
// Create a new module (and put it into the cache)
var module = (__webpack_module_cache__[moduleId] = {
exports: {}
});
// Execute the module function
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);

// Return the exports of the module
return module.exports;

}

// webpack/runtime/rspack_version
(() => {
__webpack_require__.rv = () => ("1.7.2")
})();
// webpack/runtime/rspack_unique_id
(() => {
__webpack_require__.ruid = "bundler=rspack@1.7.2";
})();
includeWeb("QScript R Output Functions");

const menu_location = "Regression > Diagnostic > Plot > Influence Index";
createDiagnosticROutputFromSelection(menu_location);