I am a student undertaking my Master's in Biostatistics and am working through GLM diagnostics and want to compute randomised quantile residuals (Dunn-Smyth residuals) after fitting GLMs in Stata.
My understanding is that randomised quantile residuals are considered the gold standard diagnostic tool for GLMs - they are approximately standard normal if the model is correct, regardless of the outcome distribution, which makes them much more useful than deviance or Pearson residuals for non-normal outcomes.
In R, these are straightforwardly available via qresid() from the statmod package. However, I prefer to work in Stata and am not aware of an official or SSC-validated command that computes these residuals after glm.
I found a GitHub package (https://github.com/psotob91/qresid) by Percy Soto-Becerra, which appears to implement randomised quantile residuals for normal linear regression, Gaussian GLMs, binomial/Bernoulli models (via both glm and logit/logistic commands), Poisson models (via both glm and poisson commands), and negative binomial models (via both glm and nbreg commands). Since I'm not expert enough to know if code is correct, and the package is pre-release and has not been submitted to SSC, can anyone point me to a validated Stata command for computing randomised quantile residuals after glm?
My understanding is that randomised quantile residuals are considered the gold standard diagnostic tool for GLMs - they are approximately standard normal if the model is correct, regardless of the outcome distribution, which makes them much more useful than deviance or Pearson residuals for non-normal outcomes.
In R, these are straightforwardly available via qresid() from the statmod package. However, I prefer to work in Stata and am not aware of an official or SSC-validated command that computes these residuals after glm.
I found a GitHub package (https://github.com/psotob91/qresid) by Percy Soto-Becerra, which appears to implement randomised quantile residuals for normal linear regression, Gaussian GLMs, binomial/Bernoulli models (via both glm and logit/logistic commands), Poisson models (via both glm and poisson commands), and negative binomial models (via both glm and nbreg commands). Since I'm not expert enough to know if code is correct, and the package is pre-release and has not been submitted to SSC, can anyone point me to a validated Stata command for computing randomised quantile residuals after glm?

Comment