EconPapers    
Economics at your fingertips  
 

MARKOVFIRSTORDER: Stata module for assessing whether a sequence follows an independent state model or a first-order Markov chain model

Ariel Linden

Statistical Software Components from Boston College Department of Economics

Abstract: markovfirstorder assesses whether a sequence of values follows an independent state model or a first-order Markov chain model (Avery and Henderson 1999). An independent state model assumes that the state in a particular position of the sequence is independent of the previous state. An independent state model is presented as a two-way table and evaluated using Pearson's chi-squared statistic. A statistically significant chi-squared indicates that the hypothesis of independent successive states should be rejected. Next, a first-order Markov chain model is assessed by analyzing a three-way table of the number of times that triplet (i, j, k) occurs where i, j, k = 1, 2, . . ., b. The Pearson's chi-squared statistic for a first-order Markov chain model is computed by summing the chi-squared statistic over all triplets (i, j, k), and where the degrees of freedom = k * (k - 1)^2. A statistically significant chi-squared statistic indicates that the sequence follows a higher order than a first-order Markov chain model. See Avery and Henderson (1999) for a comprehensive discussion.

Language: Stata
Requires: Stata version 11
Keywords: Markov chain model; discrete time Markov chain; first-order Markov chain; Pearson’s chi-squared (search for similar items in EconPapers)
Date: 2025-05-11, Revised 2025-05-12
Note: This module should be installed from within Stata by typing "ssc install markovfirstorder". The module is made available under terms of the GPL v3 (https://www.gnu.org/licenses/gpl-3.0.txt). Windows users should not attempt to download these files with a web browser.
References: Add references at CitEc
Citations:

Downloads: (external link)
http://fmwww.bc.edu/repec/bocode/m/markovfirstorder.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/m/markovfirstorder.sthlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matchi2.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matchi2.sthlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/a/Avery_preproglucacon.dta sample data set (application/x-stata)

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:boc:bocode:s459454

Ordering information: This software item can be ordered from
http://repec.org/docs/ssc.php

Access Statistics for this software item

More software in Statistical Software Components from Boston College Department of Economics Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA. Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().

 
Page updated 2025-06-18
Handle: RePEc:boc:bocode:s459454