rStats.js v1.3.0
    Preparing search index...

    Function glmRstandard

    • Standardized Pearson (default) or deviance residuals, for the rows of non-zero prior weight, for a glm fit. Equivalent to R's rstandard(). The residuals are divided by sigma sqrt(1 - h), sigma the square root of the dispersion, as R 4.6, whose default type is "pearson" (R before 4.6: "deviance").

      Parameters

      Returns number[]

      const fit = glm([1, 2, 3, 4, 5, 6], [0, 0, 1, 0, 1, 1], { family: "binomial" });
      glmRstandard(fit); // [-0.25904, -0.50996, 1.6658, -1.6658, 0.50996, 0.25904]
      glmRstandard(fit, { type: "deviance" }); // [-0.36205, -0.69432, 1.7753, -1.7753, 0.69432, 0.36205]