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 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.

Value

A matrix containing the residuals data.


[Package ldt version 0.5.3 Index]