This function returns residuals from or calculates the standardized residuals for an ldt.estim object.
# S3 method for ldt.estim
residuals(object, equations = NULL, standardized = FALSE, pearson = TRUE, ...)A matrix containing the residuals data.
An object of class ldt.estim.
A number, a numeric array or a string array specifying the equations with residual data. If NULL, residuals in all equations are returned.
If TRUE, standardized residuals are returned. See details.
If TRUE, it returns (or uses) Pearson residuals for binary choice regression.
Additional arguments.
The standardized residuals have identical variance. In order to calculate the standardized residuals, each residual is divided by \(s\sqrt{w_i(1-h_{ii})}\) where \(s\) is the standard error of residuals and \(h_{ii}\) is the leverage of \(i\)-th observation. \(w_i\) is the weight of the \(i\)-th observation if data is weighted, and 1 otherwise. Note that while the residuals are estimated in a system, the \(h_{ii}\) is calculated in a univariate context as the \(i\)-th diagonal of \(X(X'X)^{-1}X'\) matrix, where \(X\) is the exogenous variables in the corresponding equation.