  Self and Mauritsen (1988) developed a sample size determination procedure for
score tests in generalized linear models under contiguous alternatives. Its
performance may deteriorate when the effect size is large. We propose a
modification of the Self-Mauritsen method by taking into account of the
variance of the score statistic under both the null and alternative hypotheses,
and extend the method to noninferiority trials. The modified approach is
employed to calculate the sample size for the logistic regression and negative
binomial regression in superiority and noninferiority trials. We further
explain why the formulae recently derived by Zhu and Lakkis tend to
underestimate the required sample size for the negative binomial regression.
Numerical examples are used to demonstrate the accuracy of the proposed method.
