*! version 1.0.0 15apr2024

Title

usos -- Unweighted sum of squares test for global goodness of fit after logistic model

Syntax

usos

weights are not allowed.

Description

usos implements the unweighted sum of squares (USOS) test for global goodness of fit (GOF) following the estimation of a logistic/logit
model. This method has been attributed to Copas (1989) and le Cessie and van Houwelingen (1995). Hosmer et al. (1997) report that this
method (in addition to the Pearson chi-square method which is available in official Stata (logistic estat gof) offers superior power
based on simulations. As such, they recommend the use of these two GOF approaches for confirmation of model fit or lack-of-fit.

usos is based on Frank Harrell's residuals.lrm package in R (https://cran.r-project.org/web/packages/rms/rms.pdf).

Examples

Set up

. webuse lbw, clear

Fit logistic regression to predict low birth weight

. logistic low age lwt i.race smoke ptl ht ui

Perform USOS goodness-of-fit test

. usos

Saved results

usos saves the following in r():

Scalars

r(sse) unweighted sum of squared errors

r(ev) expected value (H0)

r(estimate) sse - ev

r(sd) std. dev. of the estimate

r(z) z value

r(p) p value

References

Copas, J. B. 1989. Unweighted sum of squares test for proportions. Journal of the Royal Statistical Society: Series C (Applied Statistics) 38: 71-80.

Hosmer, D. W., Hosmer, T., Le Cessie, S. and S. Lemeshow. 1997. A comparison of goodness‐of‐fit tests for the logistic regression model.
Statistics in Medicine 16: 965-980.

Le Cessie, S. and H. C. Van Houwelingen. 1995. Testing the fit of a regression model via score tests in random effects models. Biometrics 51: 600-614.

Citation of usos

usos is not an official Stata command. It is a free contribution
to the research community, like a paper. Please cite it as such:

Linden, Ariel. 2024. usos: Stata module for computing the unweighted sum of squares test for global goodness of fit after logistic model.

Author

Ariel Linden

President, Linden Consulting Group, LLC

alinden@lindenconsulting.org

Acknowledgments

I wish to thank John Moran for advocating that I write this package.

Also see

Online: logistic estat gof