The deviance χ2 value is,
where g is the number of replicate groups in the design, ni is the number of runs, yi is the number of successes (1s), and ˆπi is the predicted probability in the ith replicate group.
The degrees of freedom for the test is the number of replicate groups minus the number of parameters p in the model, df=g−p.
There is evidence of poor fit if the χ2 value per degree of freedom, D/df=D/(g−p), differs significantly from 1 or the p-value is less than the α-risk.
If the design contains few replicates use the Hosmer-Lemeshow test instead.
References
Douglas C. Montgomery, Peck, Elizabeth A., and G. Geoffrey Vining. Introduction to Linear Regression Analysis. Wiley, 5th edition, 2012.