1,879
Views
3
CrossRef citations to date
0
Altmetric
Research Article

Goodness of fit test for higher order binary Markov chain models

ORCID Icon & ORCID Icon | (Reviewing Editor)
Article: 1421003 | Received 31 Jul 2017, Accepted 20 Dec 2017, Published online: 24 Jan 2018

Abstract

When the interest is in making statements about change based on repeated measurements of discrete data, one way to do so is using Markov chain models. Goodness of fit test to find a good model is very important in analyzing the underlying patterns and relationships in the repeated measures data. To test for the various associations in the models, the likelihood ratio and Wald tests are used. However, it has been observed that the efficient score tests can provide equally good tests and can provide an easier alternative. In this paper, we provide an extension of Tsiatis method for goodness of fit test on higher order Markov chains. In our method, we follow the approach of Tsiatis goodness of fit test in logistic regression models. New method provided in this paper is applied to real-life data to examine the suitability of the techniques.

Public Interest Statement

In this paper, an important test procedure arising from repeated measurements of discrete data have been introduced. In real-life situations, the change in the status of a disease or other outcome variables need to be examined. These changes need to be studied to understand the underlying factors influencing transitions in the status during specified time intervals. We can employ Markov models in order to find the relationships between the risk factors and outcome variables. The models can be of first or higher orders. One formidable challenge in employing these models is to confirm goodness of the model for first or higher order. This paper provides a simple test that can be used to test goodness of fit of higher order Markov models with covariate dependence for binary data. The proposed test procedure appears to be very useful technique in providing the goodness of fit of higher order binary Markov chains.

1. Introduction

Markov chain models are used in various applied fields, such as time series analysis, longitudinal studies, life data, environmental problems. The behavior of a Markov chain depends on the transition matrix, which contains transitional probabilities. In most practical studies, the transition matrix is unknown and needs to be estimated. Several methods are available for the estimation and test procedure of transition probabilities. However, most researchers have worked primarily on the estimation of parameters and only a few reports on test procedures. One of the most important tests on Markov chain models is the stationarity of transition probabilities and the goodness of fit of Markov chain models. This section presents a brief summary of the tests performed on Markov chain.

Anderson and Goodman (Citation1957) obtained the maximum likelihood estimates and their asymptotic distribution for the transition probabilities in a Markov chain of arbitrary order with repeated observations of the chain. The likelihood ratio tests and chi-square tests used in contingency tables were obtained for testing these hypotheses. Billingsley (Citation1961) used Whittle’s formula, chi-square, and maximum likelihood methods to test for stationarity and order of the higher order Markov chain. Mcqueen and Thorley (Citation1991) used Markov chain to analyze annual stock returns. Albert (Citation1994) proposed a class of Markov models for analyzing sequences of ordinal data from a relapsing-remitting disease, where the state space was expanded to include information about the ordinal severity score as well as the relapsing-remitting status. He proposed a parameterization that can reduce the number of parameters. It is noteworthy that most of these research works have been conducted for estimating parameters based on the first-order Markov chain. Recently, several new methods for higher order Markov chains have been reported, where the estimation and test procedures became quite complex due to the increased order of the models (Chowdhury, Islam, Shah, & Al-Enezi, Citation2005; Islam & Chowdhury, Citation2006; Islam, Chowdhury, & Briollais, Citation2012; Rahman & Islam, Citation2007).

However, less effort is given towards studying the field of covariate-dependent Markov models (Muenz & Rubinstein, Citation1985; Yi, He, & Liang, Citation2009). In this paper, a test procedure for the goodness of fit of a binary Markov chain model is proposed by extending Tsiatis’ procedure (Tsiatis, Citation1980). The proposed test was extended for the second- and higher order of the Markov chain model. The efficient score test was used for testing null hypotheses, which only required the estimate of parameters under true null hypothesis. The proposed model and test procedures were thoroughly examined using a set of data for the elderly population and employing simulations.

Sirdari, Islam, and Awang (Citation2013) proposed the goodness of fit test for higher order binary Markov chain models based on marginal distribution. The problem with this proposal was that marginal distribution has limited assumptions because of the correlations between variables, which are not easy to estimate. Thus, the proposed model in this study was based on the conditional transition probabilities, which means that there is no correlation between variables.

2. A brief overview of the test proposed by Tsiatis (Citation1980)

Tsiatis (Citation1980) proposed a goodness of fit test for the logistic regression model. In terms of binary data analysis, this model relates the probability of a response to a set of covariates χ1,,χp according to Equation (2.1):(2.1) logpχ/1-pχ=βχ,pZ=expβχ1+expβχ,(2.1)

where pχ denotes the conditional probability of response given by the vector, χ=χ1,,χp, χ0 = 1, and β=β0,,βp denotes the regression coefficients. The space of covariates χ1,,χp is partitioned into k distinct region in p-dimensional space, denoted by R1,,Rk. The indicator functions, Ijj=1,,k, are defined by Ij=1 if χ1,,χpRj and Ij=0.

Tsiatis considered the following model in Equation (2.2):(2.2) logpχ/1-pχ=βχ+γI,(2.2)

where I=I1,,Ik and γ=γ1,,γk. The goodness of fit test consists of testing the hypothesis H0:γ1==γk=0.

This test is based on the efficient score test, as represented by Equation 2.3:(2.3) T=ZV-1Z,(2.3)

where Z is the k-dimensional vector l/γ1,,l/γk and l denotes the log-likelihood. The k × k matrix, V is equal to:V=A-BC-1B,

whereAjj=-2l/γjγjj,j=1,,k,

Bjj=-2l/γjβjj=1,,k;j=0,,p,Cjj=-2l/βjβj(j,j=0,,p)

All previous terms were evaluated at γ=0 and βj=β^j, where β^j is the maximum likelihood estimate of the parameters when is true.

3. Goodness of fit test of first-order Markov chains

Consider the case of a single stationary process, Y1,,YT, generated by a binary Markov chain that uses values of 0 and 1. The transition matrix is defined by:P=p00p01p10p11=1-p01p011-p11p11

where pjt=PrYt=1|Yt-1=j;j=0,1,t=1,,T.

The transition probabilities, pjt, can be modeled using logistic regression, as shown by Model (3.1):(3.1) logitpjt=βjχt,pjt=expβjχt1+expβjχt.(3.1)

Vector χt contains covariates and it is equal to χt=1,χt1,,χtp. βj is the vector of parameters, βj=βj0,βj1,,βjp. The likelihood function that corresponds to Model (3.1) is:L=tj=011-pjtnj0tpjtnj1t

where n00t,n01t,n10t,andn11t are the number of transitions of each type observed at time t. The log-likelihood is as shown by Equation (3.2):(3.2) l=t=1Tj=01nj1tβjχt-nj0t+nj1tln1+expβjχt.(3.2)

The log-likelihood can be shown as, l=lnL=lnL0+lnL1, wherelnL0=t=1Tn01tβ0χt-n00t+n01tln1+expβ0χt,lnL1=t=1Tn11tβ1χt-n10t+n11tln1+expβ1χt.

It was assumed that the space of covariate χt1,,χtp was partitioned into G distinct regions in p-dimensional space, denoted by R1,,RG. The indicator functions, Itkk=1,,G, are defined by Itk=1 if χt1,,χtpRk and Itk=0.

Then, for a binary Markov chain, the following Model (3.3) was considered:(3.3) logitpjt=βjχt+γjIt,(3.3)

where It=It1,,ItG and γj=γj1,,γjG is an arbitrary covariate vector. This test was performed by testing the null hypothesis, H0:γj1==γjG=0. This hypothesis was proposed by partitioning the space of covariates into distinct regions and calculating a test statistic, which was a quadratic form of the observed counts, excluding the expected counts.

The efficient score test and the likelihood ratio test were also used. Both statistics have asymptotic chi-square distribution, with G degrees of freedom, as proven by Rao (Citation1973). The current test used in this study was based on the efficient score test because it only requires an estimate of βj under the null hypothesis, whereas the likelihood ratio statistics needs an estimate of γj under the alternative model. The test statistics is defined by Equation (3.4):(3.4) T=ZV-1Z,(3.4)

where Z=Z0Z1 and Zj,j=0,1 is the G-dimensional vector l/γj1,,l/γjG. The matrix, V, is equal to:V=V000V1

and the G × G matrix, Vj,j=0,1Vj=Aj-BjCj-1Bj,

whereAjkk=-2l/γjkγjkk,k=1,,G,Bjkk=-2l/γjkβjkk=1,,G;k=0,,p,Cjkk=-2l/βjkβjkk,k=0,,p.

All previous terms were evaluated at γj=0 and β=β^, where β^ is the maximum likelihood estimate of the parameters when H0 is true. Using the standard likelihood theory, a test could be extracted in the quadratic form of observed counts minus expected counts, and whose large sample properties are easily established.

It is evident that the log-likelihood for Model (3.3) can be achieved by inserting Equation (3.2), as follows:

l=t=1Tj=01nj1tβjχt+γjIt-nj0t+nj1tln1+expβjχt+γjIt=lnL0+lnL1=l0+l1.

The kth element of vector χt used in the computation of Equation (3.4) is the partial derivative of lj,j=0,1, with respect to γjk at γj=0 and βj=β^j,t=1Tnj1tItk-t=1Tnj0t+nj1tItkexpβjχt1+expβjχt=Ojk-Ejk,

where Ojk and Ejk are the observed and expected numbers of responses in the kth region. Therefore, Equation (3.4) is the quadratic form of the vector of observed counts minus expected counts.

Quantities necessary for computing the covariance matrix, Vj,j=0,1 are as follows:Ajkk=ξknj0t+nj1tp^jt1-p^jtk=k0kk;k,k=1,,GBjkk=ξknj0t+nj1tχtkp^jt1-p^jtk=1,,G;k=0,,p,Cjkk=t=1Tnj0t+nj1tχtkχtkp^jt1-p^jtk,k=0,,p,

where, ξk denotes the set of indices t, such thatχt1,,χtpRk,p^jt=expβ^jχt/1+expβ^jχt.

4. Extension of the model for higher-order Markov chains

Consider the nth-order Markov model for times, t-n,t-n-1,,t-1, and t, with transition matrix, P, and its components:prsjt=PrYt=1|Yt-n=r,,Yt-2=s,Yt-1=j;j,s,r=0,1,t=1,,T.

The logistic regression model for prsjt is:logitprsjt=βrsjχt,prsjt=expβrsjχt1+expβrsjχt,

where vector, χt=1,xt1,,xtp, contains covariates and βlsj=βrsj0,βrsj1,,βrsjp is the vector of parameters.

The likelihood function corresponding to this model is as follows:L=tj=01s=01r=011-prsjtnrsj0iprsjtnrsj1i

The log-likelihood is:

l=t=1Tj=01s=01r=01nrsj1tβrsjχt-nrsj0t+nrsj1tln1+expβrsjχt=r,s,j=01lnLrsj,

where for r,s,j=0,1,lnLrsj=t=1Tnrsj1tβrsjχt-nrsj0t+nrsj1tln1+expβrsjχt.

Then, Model (3.3) can be extended for order n, which can be written as shown by Equation (4.1):(4.1) logitprsjt=βrsjχt+γrsjIt;r,s,j=0,1.(4.1)

The related null hypothesis is H0:γrsj1==γrsjG=0, and the test statistic is shown by Equation (4.2):(4.2) T=ZV-Z,(4.2)

where Z is a 2n-dimensional vector with elements ofZrsj=l/γrsj1,,l/γrsjG,r,s,j=0,1.

The matrix, V is the 2n×2n diagonal matrix, with components of G × G matrix. Vrsj;r,s,j=0,1;Vrsj=Arsj-BrsjCrsj-1Brsj,

whereArsjkk=-2l/γrsjkγrsjkk,k=1,,G,Brsjkk=-2l/γrsjkβrsjkk=1,,G;k=0,,p,Crsjkk=-2l/βrsjkβrsjkk,k=0,,p,r,s,j=0,1.

The log-likelihood based on Model (4.1) is as follows:

l=t=1Tj=01s=01r=01nrsj1tβrsjχt+γrsjIt-nrsj0t+nrsj1tln1+expβrsjχt+γrsjIt=r,s,j=01lnLrsj=r,s,j=01lrsj

The partial derivative of lrsj,l,s,j=0,1 with respect to γrsjk,r,s,j=0,1 at γrsj=0 and βrsj=β^rsj,i=1nnrsj1tItk-i=1nnrsj0t+nrsj1tItkexpβrsjχt1+expβrsjχt=Orsjk-Ersjk.

5. Application

We applied the proposed test on the Health and Retirement Study (HRS) (Citation2009) data to demonstrate its application. This is a longitudinal household survey data-set for the study of retirement and health among the elderly in the United States. The RAND Centre collected these data to study aging, with funding and support from the National Institute on Aging (NIA) and the Social Security Administration (SSA). These data were collected from 1992 to 2006 in eight waves for 30,405 people. We considered individuals who attended the program in 1992 and then, followed up until 2006. The study was about depression among individuals (0 for no depression and 1 for depression), and age (yearly), gender (0 for male and 1 for female), body mass index (BMI), and drinking (0 for not drinking and 1 for drinking), which were considered as covariates. The space of covariate χt1,,χtp was partitioned into four distinct regions: (male and not drinking); (male and drinking); (female and not drinking); and (female and drinking). Some of these variables may contain missing values because the referenced person did not respond to the waves. Thus, we had to drop the ID of individuals from all waves if there were missing values for these covariates. There were 668 missing values in the covariates, which included 353 IDs, i.e. these individuals responded for the outcome variable, but not for the covariates. Thus, 353 IDs were dropped from the data in this work. Additionally, S-Plus functions modified by Chowdhury et al. (Citation2005) were developed and used to estimate the parameters of the model. The Newton–Raphson method was used in this program for parameter estimation.

Table shows the different types of transition counts for the first- and second-order transitions. Meanwhile, Table shows the estimated values for the covariate-dependent Markov models for different types of transitions. The results are for the first- and second-order Markov models.

Table 1. Transition counts of Markov chain of depression data for the first- and second-order

Table 2. Estimates of parameters of covariate-dependent first- and second-order Markov models and testing the goodness of fit

Billingsley’s chi-square statistics were computed using ijfij-fipij2/fipij, and Tsiatis’ statistics were estimated using Equations (3.4) and (4.2). The results showed that the data satisfied the models for the first- and second-order Markov chains. Both Billingsley’s and Tsiatis’ statistics showed similar results. However, Billingsley’s test statistics does not depend on covariates. Thus, it was used in this study to compare the results with results of the extended test based on Tsiatis’ statistics.

Estimates of the parameters for the first-order transitions demonstrated negative association between the transitions from no depression to depression with age and drinking, while positive associations were obtained with BMI and sex (females have higher risks). Those who did not change their status from depression were found to be associated negatively with age and positively with drinking. Both the Billingsley and the proposed tests showed that the first-order models can be accepted. Similarly, the second-order models indicated that age and drinking were negatively associated, while sex was positively associated for the 0-0-1 type of transition. Sex and BMI were positively associated and drinking was negatively associated for the 1-0-1 transition type, while age was negatively associated, but drinking was positively associated for the 1-1-1 transition type. Interestingly, the second-order models also appeared to have good fit in favor of the null hypothesis. These results demonstrated that both the first- and second-order models could be employed for the given set of data.

6. Simulation

Data generated by the techniques provided by Ghosh and Mukerjee, and Leisch et al. was used to examine the suitability of the proposed models. In these techniques, bindata package in R were employed for generating correlated binary data. First, data were generated from the multivariate normal random variables, and then, they were transformed into binary data. In this study, two variables were generated as the outcome variables at time t and t − 1 for the first-order Markov model, with various combinations of probabilities of occurring 1 and 0 to obtain different correlations. These results were used to compare the models under independent and selected values of measure of association. For models 1, 2, and 3, the data were generated based on correlation of 0.4 between the outcome variables at time t − 1 and t for the first-order, and at time t − 2, t − 1, and t for the second-order. Similarly, models 4, 5, and 6 were generated with correlation of 0, while models 7, 8, and 9 considered correlation of −0.4. For each model, four covariates were also generated, corresponding to the correlated response variables by considering different correlations with the outcome variables. These estimates and tests were repeated 500 times for all models, and for sample sizes of 250, 500, and 1,000 for different correlations between outcome variables. The models that were used for this simulation study were different applications of the conditional model verified in Model (3.3). The extended Tsiatis’ test for the first-order Markov model, as shown by Equation (4.2), had involved covariate patterns. Nonetheless, Billingsley’s test, which was represented by ijfij-fipij2/fipij, was used to compare the obtained results, with and without covariates. In other words, the Markov models were estimated using covariates and were employed in this test.

Table shows the simulation results for the first-order model, which included frequencies by transition type, correlation between outcome variables in the bivariate Bernoulli population, average estimates of the parameters, and the number of rejected hypotheses in 500 times of simulation for these models using Billingsley’s test and the proposed test as an extension of Tsiatis’ test. Acceptance of the null hypothesis, H0:γj1==γjG=0, would indicate a good fit of Model (4.1) to the data. The percentage of rejection for Billingsley’s test was 0 because the test procedure did not consider any covariate. However, in the proposed extension, models with covariate dependence were used. Hence, it can be concluded that the proposed test statistics depended on the covariate-dependant transition probabilities, where the selection of appropriate variables in the model may influence the goodness of fit, to a large extent. This observation implied that the proposed test may display deviations for a good fit in some instances. In other words, the goodness of fit test proposed by this study, as an extension of the Tsiatis’ test, depended on the model’s specifications in terms of the explanatory power of the selected variables. Based on the estimated covariates for the first-order transition from 0 to 1, we observed a positive association with variable 1, and a transition from 1 to 1, which has negative association with variable 1 for all models, except with model 4 (sample size of 250, with correlation of 0). The rejection percentage had varied for the first-order model, mainly in the range of 4.–6.6%. This result showed that the proposed test method was satisfactory for different sizes of samples, with different correlation of outcome variables based on the first-order Markov chain model.

Table 3. Five hundred simulations for obtaining the estimates of associations based on the proposed first-order models

The simulation results for the second-order model are given in Table . The table shows the number of transition types, correlation between outcome variables, average estimates of the parameters, and the number of rejected hypotheses, H0:γrsj1==γrsjG=0, in 500 times of simulations for the models. Results for the second-order models showed that there was no association between covariates and outcome variables, which was expected because of the higher order of the underlying Markov chain. Only two models, 3 and 6, with sample size of 1000 and correlations of 0 and 0.4, have negative associations with variable 2 in different types of transitions. The range of rejection percentage of the null hypothesis for the extended Tsiatis’ test was 3.6–6.2% for models 1–9 in the second-order. Thus, these models were acceptable for different sizes of samples and different correlations between outcome variables. Results from Billingsley’s test were compared with results from the proposed extension of Tsiatis’ test; the number of rejected null hypothesis was zero for Billingsley’s test because it does not depend on covariates. The number of rejected null hypothesis for model 3 was the lowest.

Table 4. Five hundred simulations for obtaining the estimates of associations based on the proposed second-order models

7. Conclusion

An extension of Tsiatis’ test procedure was proposed in this study for first- and higher order binary Markov models by considering repeated measures. Most of the test procedures for stationarity and order of Markov chains were based on the likelihood ratio test and the usual chi-square test. We have shown a goodness of fit for the Markov chain by considering the efficient score test, which only requires estimated parameters under the null hypothesis. The utility of the proposed test has been examined, with an example for real-life data. The results indicated the suitability of these techniques. Additionally, simulation results demonstrated a Type-I error for the proposed test. In addition, the proposed test procedure was extended for higher order models and can be extended to test the order of binary Markov chains.

Funding

The authors are grateful to the HEQEP in project 3293, from the Department of Applied Statistics, East West University, and for the sponsorships by the UGC, Bangladesh and the World Bank.

Acknowledgments

We are also thankful to Dr Rafiqul Islam Chowdhury for giving us permission to use the “kernopt markov.gen” program for parameter estimates. We would also like to thank the Health and Retirement Study (HRS) center for giving us permission to use RAND data in the application of the model.

Additional information

Notes on contributors

Mahboobeh Zangeneh Sirdari

M. Ataharul Islam is currently the QM Husain professor at the Institute of Statistical Research, University of Dhaka, Bangladesh. He is a recipient of the Pauline Stitt Award, Western North American Region (WNAR) Biometric Society Award for content and writing, East West Center Honor Award, University Grants Commission Award for book and research, and the Ibrahim Memorial Gold Medal for research. He has published more than 100 papers in international journals on various topics, mainly on longitudinal and repeated measures data including multistate and multistage hazards model, statistical modeling, Markov models with covariate dependence, generalized linear models, conditional and joint models for correlated outcomes. He supervised research of more than 100 students at MS and PhD levels. He authored books on Analysis of Repeated Measures Data, Markov models, edited one book jointly and contributed chapters in several books.

References

  • Albert, P. S. (1994). A Markov model for sequences of ordinal data from a relapsing-remitting disease. Biometrics, 50, 51–60.10.2307/2533196
  • Anderson, T. W., & Goodman, L. A. (1957). Statistical inference about Markov chains. The Annals of Mathematical Statistics, 28, 89–110.10.1214/aoms/1177707039
  • Billingsley, P. (1961). Statistical methods in Markov chains. The Annals of Mathematical Statistics, 32, 12–40.10.1214/aoms/1177705136
  • Chowdhury, R. I., Islam, M. A., Shah, M. A., & Al-Enezi, N. (2005). A computer program to estimate the parameters of covariate dependent higher order Markov model. Computer Methods and Programs in Biomedicine, 77, 175–181.10.1016/j.cmpb.2004.10.003
  • Health and Retirement Study (HRS). (2009). Produced and distributed by the University of Michigan with funding from the National Institute on Aging (Grant No. NIA U01AG09740). Waves [1-8], Year [1992–2006] [Online], [Accessed 2009]. Retrieved from World Wide Web: http://hrsonline.isr.umich.edu/data/index.html
  • Islam, M. A., & Chowdhury, R. I. (2006). A higher order Markov model for analyzing covariate dependence. Applied Mathematical, 30, 477–488.
  • Islam, M. A., Chowdhury, R. I., & Briollais, L. (2012). A bivariate binary model for testing dependence in outcomes. Bulletin of the Malaysian Mathematical Sciences Society, 35(4), 845–858.
  • Mcqueen, G., & Thorley, S. (1991). Are stock returns predictable? A test using Markov chains The Journal of Finance, 46, 239–263.10.1111/j.1540-6261.1991.tb03751.x
  • Muenz, L. R., & Rubinstein, L. V. (1985). Markov models for covariate dependence of binary sequences. Biometrics, 41, 91–101.10.2307/2530646
  • Rahman Shafiqur, M., & Islam, M. A. (2007). Markov structure based logistic regression for repeated measures: An application to diabetes mellitus data. Statistical Methodology, 4, 448–460.10.1016/j.stamet.2007.01.006
  • Rao, C. R. (1973). Linear statistical inference and its applications (2nd ed.). New York, NY: Wiley.10.1002/SERIES1345
  • Sirdari, M. Z., Islam, M. A., & Awang, N. (2013). A stationarity test on Markov chain models based on marginal distribution. Statistical Methodology, 11, 68–76.10.1016/j.stamet.2012.10.001
  • Tsiatis, A. A. (1980). A note on a goodness-of-fit test for the logistic regression model. Biometrika, 67, 250–251.
  • Yi, G. Y., He, W., & Liang, H. (2009). Analysis of correlated binary data under partially linear single-index logistic models. Journal of Multivariate Analysis, 100, 278–290.10.1016/j.jmva.2008.04.012