EconPapers    
Economics at your fingertips  
 

A simple approach to compute generalized residuals for nonlinear models

Tibor Szendrei and Arnab Bhattacharjee

UK Stata Conference 2025 from Stata Users Group

Abstract: In models where the relationship between the outcome and the error term is linear, a residual can be computed by simply plugging in the estimated coeacients and computing the difference between observed and predicted values of the outcome variable. These residuals can then be used for many different purposes, for example: (a) evaluating assumptions of orthogonality of errors (like Rxed and random effects); (b) examining the entire shape of the error distribution; and (c) computation and inference on externalities such as network effects. However, this simple approach does not work when the model is nonlinear in outcomes and errors. Here different context-speciRc generalized residuals have been proposed, each having different properties for speciRc models. Note that for the canonical linear or nonlinear Gaussian regression model, the above construction is simply a scaled version of the partial derivative of the log-likelihood contribution of an individual observation with respect to the outcome variable. This suggests a general construction of generalized regression by perturbing the outcome variable and computing contrasts. This approach is closely related to Huber's inXuence function and can be routinely computed using Stata, for example, and also parallelized for large datasets. We propose this general construction of generalized residuals and evaluate its use in several contexts: (a) quantile regression and evaluation of conditional quantiles at the tails (for example, growth at risk); (b) computing errors distributions (for example, binary regression and random- effects models); and (c) computing network externalities in discrete choice and duration models. This delivers a uniRed approach with promising Rndings.

Date: 2025-09-04
References: Add references at CitEc
Citations:

Downloads: (external link)
http://repec.org/lsug2025/
Our link check indicates that this URL is bad, the error code is: 403 Forbidden

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:boc:lsug25:17

Access Statistics for this paper

More papers in UK Stata Conference 2025 from Stata Users Group Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().

 
Page updated 2025-09-16
Handle: RePEc:boc:lsug25:17