# Misspecification in Generalized Linear Mixed Models and Its Impact on the Statistical Wald Test
## 2 Materials and Methods
### Poisson and Negative Binomial Models with Random Intercept  
For the simulation study of generalized linear mixed models with a Poisson or NB response and random intercept, the same structure featured in the article by [26] was used, which focused on studying the impact on the probability of a type I error when ignoring overdispersion in longitudinal configurations, for which the authors generated Poisson and NB responses with the mean \(\mu_{\mathrm{ij}}=\exp\bigl{(}\beta_{0}+\mathrm{b}_{\mathrm{i}}+\beta_{1} \mathrm{t}_{\mathrm{ij}}+\beta_{2}\mathrm{z}_{\mathrm{i}}+\beta_{3}\mathrm{t }_{\mathrm{ij}}\mathrm{z}_{\mathrm{i}}\bigr{)}\) where \(\mathrm{i}=1,2,\ldots,\mathrm{m}\) and \(\mathrm{t}_{\mathrm{ij}}=1,2,\ldots,\mathrm{n}_{\mathrm{i}}\) denoting the subject and the time of measurement, respectively. In addition, \(\mathrm{b}_{\mathrm{i}}\sim\mathrm{N}\bigl{(}0,\sigma_{\mathrm{b}}^{2}\bigr{)}\), and \(\mathrm{z}_{\mathrm{i}}\) is an indicator variable of group treatment taking values of \(0/1\). Equation (5) shows the model that was used for the Poisson, and Equation (6) shows the one used for NB:  
\[ \begin{array}{c}\text{y}_{\text{ij}}|\text{b}_{\text{i}}\ \widehat{\text{ind}}.\ \ \text{Poisson}\\ \text{log}(\mu_{\text{ij}})=\beta_{0}+\text{b}_{\text{i}}+\beta_{1}\text{t}_{ \text{ij}}+\beta_{2}\text{z}_{\text{i}}+\beta_{3}\text{t}_{\text{ij}}\text{z}_ {\text{i}}\\ \text{b}_{\text{i}}\ \widehat{\text{ind}}.\ \text{G}_{\text{T}}\end{array}  \tag{5}\]  
\[ \begin{array}{c}\text{y}_{\text{ij}}|\text{b}_{\text{i}}\ \widehat{\text{ind}}.\ \ \text{BN}\ \mu_{ \text{ij}},\alpha=0.5\\ \text{log}(\mu_{\text{ij}})=\beta_{0}+\text{b}_{\text{i}}+\beta_{1}\text{t}_{ \text{ij}}+\beta_{2}\text{z}_{\text{i}}+\beta_{3}\text{t}_{\text{ij}}\text{z}_ {\text{i}}\\ \text{b}_{\text{i}}\ \widehat{\text{ind}}.\ \text{G}_{\text{T}}\end{array}  \tag{6}\]  
The \(\text{b}_{\text{i}}\) were generated based on 4 different distributions \(\text{G}_{\text{T}}\), normal, mixture of 2 normal distributions, uniform and lognormal [4,27,28], with media 0 and 4 variance values: \(\sigma_{\text{b}}^{2}=1,\,2,\,4\) and 8 (Figure 1). To assess the impact of incorrectly specifying the distribution of the random intercept on the type I error and the power of the Wald test, \(\beta_{2}\) was used as the parameter of interest. This parameter assumed the values of \(\beta_{2}=0,\ 0.5,\ 1.0,\ 1.5\) for the Poisson response case and values of \(\beta_{2}=0,\ 1.5,\ 2.0,\ 2.5\) for the NB case (Table 1). For the other parameters, the values used in the simulation were fixed as \(\beta_{0}=-2,\ \beta_{1}=-0.5\) and \(\beta_{3}=1.0\). In practice, small samples for cluster are often available; for this reason, in this study four different sample sizes, \(\text{n}_{\text{i}}=5,\ 10,\ 15,\ 20\), were considered. The number of conglomerates was fixed at \(\text{m}=100\) conglomerates. For each scenario given by the combination of \(\text{n}_{\text{i}}\), \(\beta_{2}\), and the true distribution of \(\text{b}_{\text{i}}\) and \(\sigma_{\text{b}}^{2}\), 1000 sets of data were simulated with the structure (5) and 1000 with the structure (6) (e.g., 1000 sets of data with \(\text{n}_{\text{i}}=5,\ \beta_{2}=1.5\), true distribution = uniform, \(\sigma_{\text{b}}^{2}=2\) \begin{table}
\begin{tabular}{c c c} \hline \hline
**Hypothesis** & **Poisson** & **BN** \\ \hline \(\text{H}_{\text{6}}\):\(\text{\beta}_{\text{2}}=0\ \text{vs.}\ \text{H}_{\text{1}}\):\(\text{\beta}_{\text{2}}\
eq 0\) & \(\text{\beta}_{\text{2}}=0.0.5,1.1.5\) & \(\text{\beta}_{\text{2}}=0.1.5,2.2.5\) \\ \hline \hline \end{tabular} Source: authors.  
\end{table} 
Table 1: Hypothesis of interest and \(\beta_{2}\) values used for the simulations of a GLMM with random intercept. Figure 1: Distributions for the random intercept: normal, mixture of two normal distributions, uniform and lognormal, with media 0 and variance 2.  
and structure (5)), and subsequently, the GLMM was adjusted with the function glmer for the Poisson case and with the function glmer.nb for the NB case.