1 Introduction

In designed longitudinal studies, the aim is to estimate the mean response at a certain time based on fixed or time-varying covariates. For studies with long follow up periods, the proportion of individuals with missing data can be substantial. Inference based on the observed data may lead to biased and unreliable results. Ample amount of research works on the modeling of longitudinal data with ignorable missingness are available in the literature (Little and Rubin 2002). In this paper, we focus on modeling of longitudinal data when the missingness mechanism is nonignorable. In these cases, the distribution of the observed response and indicators of missingness should be modelled jointly. Such joint models can be classified into either pattern mixture models or selection models. Little (1995) provided a detailed overview of pattern mixture models and selection models for longitudinal studies with missing data due to informative dropout. Siddiqui and Ali (1998) considered random-effects pattern-mixture models and provided estimates of the associated parameters by averaging the estimates obtained from different subsets of the data depending on the missing data-patterns. Daniels and Hogan (2000) proposed a reparameterization of the pattern mixture model that allows consideration of a wide range of nonignorable missing-data mechanisms. Diggle and Kenward (1994) proposed the use of a selection model with a logistic regression form to deal with informative dropout. Baker (1995) considered repeated binary data with nonignorable and non-monotone missingness. Troxel et al. (1998) extended those of Diggle and Kenward (1994) for non-monotone and nonignorable missing data. However, its implementation is computationally challenging. Rotnitzky et al. (1998) considered inverse probability weighted estimating equations for the nonignorable missing and provided a simultaneous estimation of the dropout probability and mean response based on the selection model. Minini and Chavance (2004) considered a log-linear model and provided a sensitivity analysis for the longitudinal binary data with nonignorable missingness.

In the context of survival analysis, shared random-effects (SRE) model proposed by Wu and Carrol (1998), is popularly used as an alternative to the selection models. De and Tu (1994) and Schluchter (1994) suggested some extensions of SRE models. Have et al. (1998) and Pulkstenis et al. (1998) adopted the SRE model for binary longitudinal data with the informative dropouts. Tsonaka et al. (2009) considered semi-parametric shared parameter model for the modelling of the response variable with non-monotone and nonignorable missingness. In the aforementioned SRE models, the selection model and the response model have exactly the same random component.

In many situations, the latent factors affecting the missingness could be different from those affecting the response; however, they are correlated due to common risk factors. In order to model such phenomena, Lin et al. (2010) considered an interesting generalization of SRE model by using correlated random effects model. An underlying assumption for the random-effects model is that, conditional on the random effects, the missingness is independent of the response. Note that ignorable missingness is a special case of the correlated random-effects model if the two random effects are independent. A main concern in the random-effects models is computational challenges arise in the model fitting due to intractable numerical integration involved in the log-likelihood function. In order to overcome such difficulties, well-known approximation methods like the Gauss–Hermite quadrature (Pinheiro and Bates 1995) and the Laplace approximation (Breslow and Clayton 1993) are exploited for estimation purposes. Lin et al. (2010) expressed the likelihood as a ratio of two integrals and then approximated the numerator and denominator using the Laplace formula. In order to estimate the associated model parameters, one needs to evaluate first and second derivatives and maximize the two integrands.

We propose alternative modeling of the observed response and indicators of missingness based on correlated latent variables. In particular, we develop regression models with the covariates having a time-varying effect and time-invariant effects on the latent variables involving correlated random effects. A simple Gibbs sampler is developed following Albert and Chib (1993), where in each iteration, we sample the model parameters as well as the latent variables. Our method is simple because it is based on the Gibbs sampler, and it is fast since we estimate the parameters for both the models simultaneously in an automated manner and avoids the computational challenges posed by intractable log-likelihood functions typically encountered in the frequentist method. The rest of the paper is organized as the follows. In Sect. 2, we discuss our proposed model and the Bayesian estimation method in detail. We analyze data from a longitudinal study of the social development of children with autism in Sect. 3. Simulation studies are performed for assessing the effectiveness of the proposed method and the results are finally summarized in Sect. 4. In Sect. 5, we provide outlines of possible future work and some concluding remarks.

2 Proposed model

In the following presentation, we consider a continuous response measured over m different time points from n subjects. We consider a set of covariates, some of which possibly have a time-varying effect on the response. The response for the ith subject at the tth time point, which we denote by \(Y_i(t)\), can thus be modelled as the following:

$$\begin{aligned} Y_i(t)=\sum \limits _{j=1}^{J} \beta _j(t) X_{ji}(t)+ \sum \limits _{j'=1}^{J'} \gamma _{j'} Z_{j'i}(t)+\sum \limits _{l=1}^{L}u_{li} \tilde{Z}_{li}(t)+e_{i}(t), \end{aligned}$$
(1)

where we consider J, \(J'\) and L denote the number of covariates with time-varying fixed effects, time-invariant fixed effects and random effects on response, respectively. Subject-specific random effects \(\mathbf u _i=(u_{1i},\ldots , u_{Li})\)’s capture the longitudinal dependence and are assumed to be iid \(N_{L}(\mathbf 0 ,\varSigma _{u})\). The residuals \(e_i(t)\)’s are assumed to be iid \(N(0,\sigma ^2_{e}\)). Note that the above model is a special case of generalized varying coefficient model for longitudinal data, introduced by Sentrk et al. (2013).

In general, the data from longitudinal studies involving large number of people possesses some missing responses. In many situations, the missing data mechanism is ignorable and it can be well handled using several available methodologies under the assumption of missing at random (MAR) (Little 1995). However, when there are nonignorable missing values in the response variable, the models in Eq. (1) will produce biased estimates under the MAR assumption. Such data are not so uncommon, specially in biomedical studies and social sciences (Little and Rubin 1987, Ch-1). In order to address such issues, we first define \(U_{i}(t)\) as

$$\begin{aligned} U_{i}(t) =\left\{ \begin{array}{ll} 1,&{}\quad \text {if}\,\,Y_{i}(t)\,\,\text {is observed}, \\ 0,&{}\quad \text {if}\,\,Y_{i}(t)\,\,\text {is missing}, \end{array}\right. \end{aligned}$$

and rewrite \(Y_{i}(t)\) as

$$\begin{aligned} Y_{i}(t) =\left\{ \begin{array}{ll} Y^{*}_{i}(t),&{}\quad \text {if}\,\,U_{i}(t) = 1, \\ \text {missing},&{}\quad \text {if}\,\,U_{i}(t) = 0, \end{array}\right. \end{aligned}$$

where \( Y^{*}_i(t)\) is a latent random variable. We then rewrite the regression model given in Eq. (1) in terms of the latent random variables as follows

$$\begin{aligned} Y^{*}_i(t)=\sum \limits _{j=1}^{J} \beta _j(t) X_{ji}(t) +\sum \limits _{j'=1}^{J'} \gamma _{j'} Z_{j'i}(t)+\sum \limits _{l=1}^{L}u_{li} \tilde{Z}_{li}(t)+e_{i}(t). \end{aligned}$$
(2)

In addition, we consider the latent variable \( U^{*}_{i}(t)\) and write

$$\begin{aligned} U_{i}(t) =\left\{ \begin{array}{ll} 1,&{}\quad \text {if}\,\,U^{*}_{i}(t)> 0, \\ 0,&{}\quad \text {if}\,\,U^{*}_{i}(t) \le 0. \end{array}\right. \end{aligned}$$

Now we consider the following model for missing data mechanism with some covariates as

$$\begin{aligned} U^{*}_{i}(t)=\sum \limits _{k=1}^{K} \theta _k(t) W_{ki}(t)+\sum \limits _{k'=1}^{K'} \delta _{k'} S_{k'i}(t) +\sum \limits _{l=1}^{L}v_{li} \tilde{Z}_{li}(t)+\epsilon _{i}(t), \end{aligned}$$
(3)

where the random effects \(\mathbf v _i=(v_{1i},\ldots ,v_{Li})\)’s are assumed to be iid \(N_{L}(\mathbf 0 ,\varSigma _{v}\)), and the residuals \(\epsilon _i(t)\) are iid N(0, 1). In order to incorporate the possible correlation between the response variable \(Y_{i}(t)\) and the missing indicator \(U_{i}(t)\), we consider \(\mathbf u _{i}\) and \(\mathbf v _{i}\) are correlated random vectors following a multivariate normal distribution with mean vector \(\mathbf 0 \) and covariance matrix \(\varSigma =\bigl ({\begin{matrix}\varSigma _{u}&{}\quad \varSigma _{uv} \\ \varSigma _{uv} &{}\quad \varSigma _{v}\end{matrix}} \bigr )\). For the aforementioned models, we can use the usual models for multivariate longitudinal data (Diggle et al. 2002, p. 332) but this requires values of the latent variables at each step. We propose a Bayesian estimation method for simultaneous estimation of the parameters associated with the joint model using Gibbs sampling.

2.1 Modelling time-varying coefficients

One of the major advantages of the longitudinal studies is to incorporate age effect in the modeling and its capacity to distinguish changes in the response within and across individuals over time (Diggle et al. 2002, p. 1). In order to model the effects of the respective covariates over time, we have considered the time-varying coefficients \(\beta _j(t)\) and \(\theta _k(t)\) in Eqs. (2) and (3), respectively. Since parametric nature of \(\beta _j(t)\) and \(\theta _k(t)\) is not known in advance, we consider semi-parametric approach of modelling the time-varying coefficients using Legendre polynomials (LP) basis functions. These Polynomials have already been proven as powerful tool by several authors for semi-parametric regression (Marie and Sen 1985; Meyer 2000; Cui and Zhu 2006; Bhuyan et al. 2019).

The general form of a Legendre Polynomial of order r is given by the following sum

$$\begin{aligned} P_{r}(x)=\sum \limits _{l=0}^{L} (-1)^{l}\frac{(2r-2l)!}{2^{r}l!(r-l)!(r-2l)!}x^{r-2l}, \end{aligned}$$

where \(L=\frac{r}{2}\) or \(\frac{r-1}{2}\), whichever is an integer. These polynomials are defined over [− 1, 1] and are orthogonal to each other in this interval in the sense that the inner product \(\int _{-1}^{1}P_{r}(x)P_{s}(x)dx=0\), for \(r\ne s\). First few LPs are as the following:

$$\begin{aligned} P_0(x)=1,\;\;P_1(x)=x,\;\;P_2(x)=\frac{1}{2}(3x^2-1), \;\;P_3(x)=\frac{1}{2}(5x^3-3x). \end{aligned}$$

In our context, we denote the rth order Legendre polynomial (LP) at time t by \(P_{r}(t)\). We transform the original time points t to the adjusted time points \( t^{'}=-1+2(\frac{t-t_{min}}{t_{max}-t_{min}})\), for fitting the orthogonal LP over the range [− 1, 1], where \(t_{min}\) and \(t_{max}\) are the smallest and the highest time points respectively. Let \(P^{(r)}(t^{'})= [P_{0}(t^{'}), P_{1}(t^{'}),\ldots ,P_{r}(t^{'})]^{T}\) denote the family of the first \(r+1\) basis functions and express the functions \(\beta _j(t^{'})\) and \(\theta _k(t^{'})\) as some linear combinations of these basis functions:

$$\begin{aligned} \beta _j(t)=\mathbf a _{j}^{T}P^{(r_1)}(t);\quad \theta _k(t)=\mathbf b _{k}^{T}P^{(r_2)}(t), \end{aligned}$$

where \(\mathbf a _{j}=(a_{j0},a_{j1},\ldots ,a_{jr_1})^{T}\), and \(\mathbf b _{k}=(b_{k0},b_{k1},\ldots ,b_{kr_2})^{T}\) are called base vectors. The optimal orders \(r_1\) and \(r_2\) may be chosen by the information criteria, e.g. AIC/BIC etc. Unless great flexibility is required, very low values of \(r_{l}\) such as 1 or 2 will suffice, for \(l=1,2\). For example, let us consider \(J=2\), \(J'=0\), \(L=1\), \(r_{1}=r_{2}=1\), \(X_{1i}(t)=1\), \(\tilde{Z}_{1i}(t)=1\) and \(X_{2i}(t)\equiv X_{2i}\) is a time-invariant covariate. Then Eqs. (2) and (3) reduces to

$$\begin{aligned} Y^{*}_i(t)= \alpha _{10} +\alpha _{11}t+\alpha _{20}X_{2i} +\alpha _{21}t X_{2i} +u_{1i}+e_{i}(t), \end{aligned}$$
(4)

and

$$\begin{aligned} U^{*}_i(t)= \lambda _{10} +\lambda _{11}t+\lambda _{20}X_{2i} +\lambda _{21}t X_{2i} +v_{1i}+\epsilon _{i}(t), \end{aligned}$$
(5)

respectively, where \(\varvec{\alpha }_{j}=(\alpha _{j0}, \alpha _{j1})^{T}\)’s and \(\varvec{\lambda }_{j}=(\lambda _{j0}, \lambda _{j1})^{T}\)’s are suitably adjusted for the change in location and scale in time, for \(j=1,2\). The models (4) and (5) account for the age effects and its interaction with the covariate \(X_{2i}(t)\). Note that the parameters involved in LPs possesses interesting interpretations and it is easy to implement. Moreover, computational complexities (e.g., knot selection, knot location) related to the other basis functions can be automated.

2.2 Bayesian estimation using Gibbs sampler

We employ a Bayesian approach of estimating the model parameters for the Eqs. (2) and (3) using the Gibbs sampler. Let \(\varTheta =[\mathbf a ,\mathbf b , \varvec{\gamma },\varvec{\delta }, \sigma ^2_{e}, \varSigma ]\) denote the set of all the model parameters involved in the Eqs. (2) and (3), where the bold symbols denote the vector of the respective coefficients. Note that, one needs to sample from the joint posterior of the model parameters and unknown latent variables.

Let us denote \(Y^{*}=(Y^{*}_{11}(t),\ldots , Y^{*}_{nm}(t))\), \(U^{*}=(U^{*}_{11}(t),\ldots , U^{*}_{nm}(t))\), \(Y=(Y_{11}(t),\ldots , Y_{nm}(t))\), and \(U=(U_{11}(t),\ldots , U_{nm}(t))\), and write the joint posterior density for the latent variables and the parameters associated with the proposed model as

$$\begin{aligned} \begin{aligned}&\pi (\varTheta ,Y^{*},U^{*}|Y, U) \propto \pi (\mathbf a ,\mathbf b , \varvec{\gamma },\varvec{\delta }, \sigma ^2_{e}, \varSigma ) \times \prod \limits _{i=1}^{n} \int \prod \limits _{t=1}^{m} f(Y^{*}_{i}(t), U^{*}_{i}(t)|u_i,v_i) \\&\quad \times \left\{ 1(U^{*}_{i}(t)>0) 1(U_{i}(t)=1)+ 1(U^{*}_{i}(t)\le 0) 1(U_{i}(t)=0)\right\} g(u_i,v_i)du_idv_i, \end{aligned} \end{aligned}$$

where \(\pi (\cdot )\) is the joint prior for \(\varTheta \), and \(f(\cdot ,\cdot )\) and \(g(\cdot ,\cdot )\) are the joint distribution of \((Y^{*}_{i}(t),U^{*}_{i}(t))\), and \((\mathbf u _i\), \(\mathbf v _i)\), respectively. Following the traditional Bayesian regression, we consider the non-informative priors for \((\mathbf a ,\varvec{\gamma },\sigma ^2_{e})\) and \((\mathbf b ,\varvec{\delta })\). In addition, we consider maximal data information prior for \(\varSigma \). Therefore the joint prior distribution \(\pi (\mathbf a ,\mathbf b , \varvec{\gamma },\varvec{\delta }, \sigma ^2_{e}, \varSigma )\), can be expressed as the product of \(\pi (\mathbf a ,\varvec{\gamma }, \sigma ^2_{e})\propto \frac{1}{\sigma ^2_{e}}\), \(\pi (\mathbf b ,\varvec{\delta })\propto 1\), and \(\pi (\varSigma )\propto \frac{1}{|\varSigma |}\).

The posterior distributions of \(\varTheta \) conditional on \(Y^{*}, U^{*},Y, U\) can be derived routinely and hence we skip the details. The full conditionals for \((\mathbf a ,\mathbf b ,\varvec{\gamma },\varvec{\delta })\), \(\sigma ^2_{e}\), and \(\varSigma \) are normal, inverse gamma and inverse-Wishart, respectively. The latent variable \(Y^{*}_{i}(t)\) and \(U^{*}_{i}(t)\) are sampled from the conditional densities

$$\begin{aligned} \left\{ \begin{array}{ll} Y_{i}(t) \quad \text {with probability 1}, &{}\quad \text {if}\,\,U_{i}(t)=1,\\ N\left( \sum \limits _{j=1}^{J} \beta _j(t) X_{ji}(t)+ \sum \limits _{j'=1}^{J'} \gamma _{j'} Z_{ji}(t)+\sum \limits _{l=1}^{L}u_{li} \tilde{Z}_{li}(t),\sigma ^2_{e}\right) , &{}\quad \text {if}\,\,U_{i}(t)=0, \end{array}\right. \end{aligned}$$
(6)

and

$$\begin{aligned} \left\{ \begin{array}{ll} N\left( \sum \limits _{k=1}^{K} \theta _k(t) W_{ki}(t)+\sum \limits _{k'=1}^{K'} \delta _{k'} S_{k'i}(t)+\sum \limits _{l=1}^{L}v_{li} \tilde{Z}_{li}(t),1\right) \,\text {left truncated at 0}, &{}\quad \text {if}\,\,U_{i}(t)=1,\\ N\left( \sum \limits _{k=1}^{K} \theta _k(t) W_{ki}(t)+\sum \limits _{k'=1}^{K'} \delta _{k'} S_{k'i}(t)+\sum \limits _{l=1}^{L}v_{li} \tilde{Z}_{li}(t),1\right) \,\text {right truncated at 0}, &{}\quad \text {if}\,\,U_{i}(t)=0, \end{array}\right. \nonumber \\ \end{aligned}$$
(7)

respectively. Note that the full conditional densities of the latent variables, given by (6) and (7), are also from standard densities, and hence, one can directly apply Gibbs sampler algorithm for estimation of model parameters \(\varTheta \).

3 Data analysis

We apply our proposed method on the data arising from a prospective longitudinal study of the social development of children with autism. A total of 214 children participated in the study who were divided into three diagnostic groups at 2 years of age: autism, pervasive developmental disorder (PDD), and nonspectrum children. We consider a subset of 158 autism spectrum disorder (ASD) children, and social development information was collected for each child at ages 2, 3, 5, 9 and 13 years based on a parent-reported survey. The objective was to assess the development trajectories of these children’s socialization for different language proficiency groups. The response variable, Vineland socialization age equivalent (VSAE), was a combined score that included assessments of interpersonal relationships, play/leisure time activities, and coping skills. However, the measurements corresponding to all children at each age are not available, which resulted in \(22\%\) missing in the response variable. The children’s language development was assessed by the Sequenced Inventory of Communication Development (SICD) score at age 2, and children were categorized into three groups (SICDEGP) based on their SICD scores. The data were collected by researchers at the University of Michigan and analyzed in West et al. (2007, Ch-6) under MAR assumption.

Table 1 The estimated parameters for the autism study

Let \(Y_{i}(t)\) be the \(\log ({ VSAE})\) score of the ith child at time t, where \(t=\log ({ Age})\). Lin et al. (2010) observed that the general trend of the VSAE score is increasing with age, while there is a substantial variation of the VSAE scores among the children, and hence the logarithmic transformation has been considered. In order to incorporate the categorical variable SCIDEGP, we introduce two dummy variables SCI2 and SCI3 representing the second and third level of the SICD group, respectively, and we take SICDEGP \(=\) 1 as the reference group. As discussed in the Sect. 2.1, we consider first order LP for modeling of time-varying coefficients and the models (4) and (5) can be rewritten as

$$\begin{aligned} Y^{*}_i(t) = \alpha _{10} +\alpha _{11}t+\alpha _{20}{} { SIC}2_{2i} +\alpha _{21}t { SIC}2_{2i} + \alpha _{30}{} { SIC}3_{2i} +\alpha _{31}t { SIC}3_{2i} +u_{1i}+e_{i}(t), \end{aligned}$$

and

$$\begin{aligned} U^{*}_{i}(t)=\lambda _{10} +\lambda _{11}t+\lambda _{20}{} { SIC}2_{2i} +\lambda _{21}t { SIC}2_{2i}+ \lambda _{30}{} { SIC}3_{2i} +\lambda _{31}t { SIC}3_{2i} +v_{1i}+\epsilon _{i}(t), \end{aligned}$$

respectively. The model parameters are estimated by the Gibbs sampler, as discussed in Sect. 2.2. We run MCMC for 50,000 iterations and discard the first 10,000 iterations as burn-in. We also thin the chains by saving every 10th iteration. The convergences of the chains are monitored graphically using trace plots, plots of the autocorrelation function (ACF) and partial autocorrelation function (PACF) for the parameters of interest (see “Appendix”). The results are summarized in Table 1, which are consistent with the finding of Lin et al. (2010) based on frequentist approach. Our primary interest is to estimate the interaction effect between SICDEGP and age. Note that SICDEGP group 1 has been taken as the reference group and the estimate of the interaction effect of the \(\log ({ Age})\) with the corresponding SIC3 is larger than that of with SIC2 in magnitude. One can interpret that children in higher SICD groups can easily be socialized as they grow up. As expected, we find that age is positively associated with the missingness of VSAE score. Interestingly, the children in higher SICD group are more likely to be observed as age increases compared to those in lower SICD group. The estimates of \(\sigma ^2_{e}\) and \(\varSigma \) are 0.18 and \(\bigl ({\begin{matrix} 0.151&{}\quad -\,0.056 \\ -\,0.056 &{}\quad 0.038 \end{matrix}} \bigr )\), respectively. The negative estimate for \(\varSigma _{uv}\) suggests that children with higher VSAE scores are more likely to have missing outcomes. In order to asses the usefulness of the joint analysis, we test \( H_{0}{:}\,| \rho _{u v} | \le \delta \), where \(\rho _{u v}\) is the correlation coefficient between the random effects \(u_{1i}\) and \(v_{1i}\). We calculate the posterior probability \(P(| \rho _{u v} | > \delta | \text {Data})\) for different choices of \(\delta \), and the results are presented in Fig. 1. It is evident that the posterior probability against the null hypothesis is very high and hence, we can conclude that the joint modeling is useful for our analysis.

Fig. 1
figure 1

Posterior probability \(P\left( |\rho _{u v} | > \delta | \text {Data} \right) \) for different choices of \(\delta \)

4 Simulation study

In order to study the performance of the proposed method, we generate data from the following model:

$$\begin{aligned} Y^{*}_i(t)= \beta _{1} +\beta _{2}(t)X_{2i}(t) +\gamma _{1} Z_{1i} +u_{1i}+e_{i}(t), \end{aligned}$$

and

$$\begin{aligned} U^{*}_i(t)= \theta _{1} +\theta _{2}(t)X_{2i}(t) +\delta _{1} Z_{1i} +v_{1i}+\epsilon _{i}(t), \end{aligned}$$

where \(\beta _{2}(t)=\beta _{20}+\beta _{21}t\), and \(\theta _{2}(t)=\theta _{20}+\theta _{21}t\). We first generate data for \(n=100\) subjects at \(m=5\) evenly spaced time points, with \( \beta _{1}= 10\), \(\beta _{20}=2 \), \(\beta _{21}=5 \)\(\gamma _{1}= 15\), \(\theta _{1}=0 \), \(\theta _{20}= 15\), \(\theta _{21}=-3 \), and \(\delta _{1}=-1\). The time dependent covariate \(X_{2i}(t)\) is generated from uniform distribution with support (0, 2) and the time-invariant covariate \(Z_{1i}\) is generated from Bernoulli distribution with mean 0.6. We consider the error variance \(\sigma ^{2}_{e}=9\), and the covariance matrix associated with the random effect parameters \(\varSigma =\bigl ({\begin{matrix} 2 &{}\quad -\,1 \\ -\,1 &{}\quad 2 \end{matrix}} \bigr )\). Under the above choice of the parameters, almost \(20 \%\) observations corresponding to the response variable are missing, which is in line with the data in the real example discussed in the previous section. For the purpose of comparison, we also generate complete data from the model

$$\begin{aligned} Y_i(t)= \beta _{1} +\beta _{2}(t)X_{2i}(t) +\gamma _{1} Z_{1i} +u_{1i}+e_{i}(t), \end{aligned}$$

with the same parameter choices. For each simulated data, we generates samples from the posterior distribution of the parameters \(\beta _{1}\), \(\beta _{20}\), \(\beta _{21}\), and \(\gamma _{1}\) using the Gibbs sampler, and computed posterior mean and posterior standard deviations. This is repeated 1000 and the estimates are averaged over the 1000 simulations. We have also performed the same exercise under MAR assumption. In order to compare the performance of these models, we presented relative bias (RB), posterior standard deviation (SD) along with coverage probability in Table 2. Comparing the results from the complete and missing data analysis, we find that the estimates from our proposed method based on missing data mechanism is as good as complete data estimates. It is also evident that the proposed model performs better compared to MAR in terms of relative bias. Next, we generate data for \(n=200\) subjects at \(m=10\) evenly spaced time with the same parameter choice, which resulted in \(40 \%\) missing in the response variable. The results are summarized in Table 3. As expected, posterior standard deviation decreases for the estimates for both the complete and missing data analysis with increase in the number of observations. Even with this higher percentage (\(40 \%\)) of missing observations, our method seems to perform reasonably well in comparison with complete data analysis. Here also, the proposed model is superior compared to MAR with respect to relative bias and coverage probability.

Table 2 Results of the simulation study with \(20 \%\) missing observations (\(n=100\) and \(m=5\))
Table 3 Results of the simulation study with \(40 \%\) missing observations (\(n=200\) and \(m=10\))
Table 4 Results of the simulation study under mis-specified selection model (\(n=100\) and \(m=5\))
Table 5 Results of the simulation study under mis-specified selection model ( \(n=200\) and \(m=10\))

In order to study the sensitivity of the proposed method under mis-specified selection model, we consider the aforementioned response model with the missing data mechanism given by

$$\begin{aligned} U^{*}_i(t)= \theta _{1} +\theta _{2}(t)X_{2i}(t) +\delta _{1} Z_{1i} +\eta (Y_i(t) - \xi )+\epsilon _{i}(t), \end{aligned}$$

with \(\eta =0.5\) and \(\xi =35\). Note that the missing indicator \(U_{i}(t)\) depends on the response \(Y_{i}(t)\) through the fixed effect parameter \(\eta \). Next, we generate data for \(n=100\), \(m=5\), and \(n=200\), \(m=10\), which resulted in \(30 \%\) missing in the response variable. The summarized results are presented in Tables 4 and 5. It is not surprising that the estimates from the proposed and existing method are biased. To compare the performance of these models, we compute Bayesian information criterion (BIC) for each of the simulated datasets and it is interesting to observe that the average BIC values for the proposed model are much smaller than those of MAR (see Tables 4, 5) under the mis-specified selection mechanism. We have also computed the Deviance information criterion (DIC), and the results are similar.

5 Discussion

In this paper, a Bayesian methodology has been developed for estimation of the correlated random-effects model for longitudinal data with nonignorable missingness. Unlike the existing frequentist methods that require approximation of the intractable log-likelihood function, we provide a simple estimation methodology using Gibbs sampler. Our method is easy to implement, and as a special case, it is applicable to various other models. For example, traditional SRE models are special cases of the correlated random-effects models, which are popularly used for modeling nonignorable missing data. Moreover, the proposed method is also readily applicable to the data with ignorable missingness. The simulation results indicate that the estimates from our proposed method with missing information in response, are as good as compared to the estimates from complete data analysis. Moreover, the performance of the proposed method is superior compared to MAR even under the mis-specified selection mechanism.

In this paper, we have considered longitudinal data with a continuous response variable. Since the underlying latent response is assumed to be continuous, one can also consider our approach for the purpose of modeling a binary or count response variable with minor modification. For non-normal error and/or random effects models, the full conditionals may not be from standard distributions. One can generalize the proposed method for such cases and employ the Metropolis–Hasting algorithm for estimation purpose. Sometimes, the data sets from longitudinal studies may possess outliers along with missing information not only in the response but also in the covariates. It may be an interesting problem to deal with such data and develop a Bayesian methodology for detection of outliers in the presence of missing values.