Author
Listed:
- Marta Ponzano
(Department of Life Sciences, Health and Health Professions, Link Campus University)
- Rino Bellocco
(Department of Statistics and Quantitative Methods, University of Milano?Bicocca, Milan, Italy; 3Department of Medical Epidemiology and Biostatistics, Karolinska Institutet, Solna, Sweden.)
Abstract
Logistic regression can be used to model the relationship between a set of covariates and a binary outcome. The predicted probabilities from the estimated model are inherently identical for observations sharing the same covariate pattern. In Stata, logistic regression can be performed using the logit command and the glm command. Both procedures calculate Pearson residuals, but the underlying computation differs substantially. In logit, Pearson residuals are calculated at the level of covariate patterns, and the Pearson chi-square goodness-of-fit test statistic is obtained by summing their squared values across covariate patterns. In contrast, in glm, Pearson residuals are computed at the individual level, and the Pearson deviance is defined as the sum of their squares over all observations. Unlike logit residuals, glm residuals can potentially vary among observations sharing the same covariate pattern, depending on the observed outcomes. Unlike logit residuals, glm residuals can potentially vary among observations sharing the same covariate pattern, depending on the observed outcomes. In general, except in the case of unique covariate patterns, Pearson residuals from logit and glm are not therefore the same. To illustrate these key differences, we present an example under three distinct scenarios: a single continuous covariate, a single categorical covariate, and a set of covariates of different types. Given the importance of post-modeling estimation, it is crucial to be aware of how Pearson residuals are calculated and to recognize that the Pearson goodness-of-fit test relies on residuals computed at the covariate pattern level. We hope this contribution supports the correct interpretation and practical use of Pearson residuals in Stata.
Suggested Citation
Handle:
RePEc:boc:neur26:06
Download full text from publisher
Corrections
All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:boc:neur26:06. See general information about how to correct material in RePEc.
If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.
We have no bibliographic references for this item. You can help adding them by using this form .
If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.
For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F Baum (email available below). General contact details of provider: https://edirc.repec.org/data/stataea.html .
Please note that corrections may take a couple of weeks to filter through
the various RePEc services.