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

    Function glmHatvalues

    • Diagonal of the hat matrix of the last weighted least squares step, for the rows of non-zero prior weight, for a glm fit. Equivalent to R's hatvalues().

      Parameters

      Returns number[]

      const fit = glm([1, 2, 3, 4, 5, 6], [0, 0, 1, 0, 1, 1], { family: "binomial" });
      glmHatvalues(fit); // [0.28361, 0.37762, 0.33877, 0.33877, 0.37762, 0.28361]