residuals.ldt.estim {ldt}R Documentation

Extract Residuals Data

Description

This function returns residuals from or calculates the standardized residuals for an ldt.estim object.

Usage

## S3 method for class 'ldt.estim'
residuals(object, equations = NULL, standardized = FALSE, pearson = TRUE, ...)

Arguments

object

An object of class ldt.estim.

equations

A number, a numeric array or a string array specifying the equations with residual data. If NULL, residuals in all equations are returned.

standardized

If TRUE, standardized residuals are returned. See details.

pearson

If TRUE, it returns (or uses) Pearson residuals for binary choice regression.

...

Additional arguments.

Details

The standardized residuals have identical variance. In order to calculate the standardized residuals, each residual is divided by swi(1hii)s\sqrt{w_i(1-h_{ii})} where ss is the standard error of residuals and hiih_{ii} is the leverage of ii-th observation. wiw_i is the weight of the ii-th observation if data is weighted, and 1 otherwise. Note that while the residuals are estimated in a system, the hiih_{ii} is calculated in a univariate context as the ii-th diagonal of X(XX)1XX(X'X)^{-1}X' matrix, where XX is the exogenous variables in the corresponding equation.

Value

A matrix containing the residuals data.


[Package ldt version 0.5.3 Index]