Residuals of a generalized linear model, one per row, for a glm fit (default "deviance"). Equivalent to R's residuals(fit, type). The kind is the second argument or the option type (giving both is a RangeError).
glm
"deviance"
residuals(fit, type)
type
Optional
const fit = glm([1, 2, 3, 4, 5, 6], [0, 0, 1, 0, 1, 1], { family: "binomial" });glmResiduals(fit); // [-0.30644, -0.54776, 1.4436, -1.4436, 0.54776, 0.30644]glmResiduals(fit, "pearson"); // [-0.21925, -0.40231, 1.3546, -1.3546, 0.40231, 0.21925] Copy
const fit = glm([1, 2, 3, 4, 5, 6], [0, 0, 1, 0, 1, 1], { family: "binomial" });glmResiduals(fit); // [-0.30644, -0.54776, 1.4436, -1.4436, 0.54776, 0.30644]glmResiduals(fit, "pearson"); // [-0.21925, -0.40231, 1.3546, -1.3546, 0.40231, 0.21925]
Residuals of a generalized linear model, with the kind in the options: glmResiduals(fit, { type: "pearson" }).
glmResiduals(fit, { type: "pearson" })
const fit = glm([1, 2, 3, 4, 5, 6], [0, 0, 1, 0, 1, 1], { family: "binomial" });glmResiduals(fit, { type: "pearson" }); // [-0.21925, -0.40231, 1.3546, -1.3546, 0.40231, 0.21925] Copy
const fit = glm([1, 2, 3, 4, 5, 6], [0, 0, 1, 0, 1, 1], { family: "binomial" });glmResiduals(fit, { type: "pearson" }); // [-0.21925, -0.40231, 1.3546, -1.3546, 0.40231, 0.21925]
Residuals of a generalized linear model, one per row, for a
glmfit (default"deviance"). Equivalent to R'sresiduals(fit, type). The kind is the second argument or the optiontype(giving both is a RangeError).