Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Markov: Transition Probabilities and Matrices

    Hi,

    I've found a code for generating Markov Probabilities, which was written by Nicholas Cox (maybe he can help?): https://ideas.repec.org/c/boc/bocode...tml#statistics

    I want to analyze the mobility table for the class of sons and fathers. Where both of them can be in 4 classes (class 1: unskilled workers, class 2: skilled workers ...)
    My data are stored the following:

    Explanation of Variables:
    - every row shows a father-son combination (class of father and class of son)
    - Family ID: Is a family identifier, shows to which family they belong to (Just added here to show that my data set contains more variables than only class father and class son)
    - Class father: Shows the class the father belongs to (possible classes are 1 to 4)
    - Class son: Shows the class the son belongs to (possible classes are 1 to 4)
    Family ID Class father Class son
    1 2 3
    1 2 1
    1 2 2
    2 4 1
    3 3 3
    3 3 4
    I want to have the transition probabilities between the class of father and class of son (4*4 Matrix) I also need a matrix, since at the end I also want to compare Altham statistics, because I analyze the same thing for grandfathers and grandsons. So I can compare at the end if there are differences between father-son and grandfather-son.

    With the code presented by Nicholas Cox I wasn't able to use this code to get the transition probabilities (since it calcuates it in another way, as I understood it takes the transition within a column, whats not what I want. Since I need the transition between the row class father and class son).

    Every support is highly appreciated

  • #2
    Please read the description given by

    Code:
     
    ssc desc markov

    Comment


    • #3
      That's what I did when I installed your code (and also the tabchi code), but I wasn't sure if I can use it this way.
      Since, as I mentioned above, I don't have panel data (but only one data point for the son and one for the father). Your command let me only write something like:

      markov class father

      , but in this way I can't figure out transition probabilities from father to son, what I would like to have (and also as a matrix).

      Do you know what I mean? Maybe I don't understand your code.

      Comment


      • #4
        I'm not sure I understand your situation, but it looks to me as if you have multiple father-son pairs in the same family. Is that right? What does it mean. Is the father in observation 2 the same person as the father in observation 1, and the sons in those observations are brothers? I make that inference because it seems that within each family, father class is constant, but son class can vary.

        If that is what's going on here, then you don't have a Markov process, or at least not in the usual sense. But if you are seeking the probability distributions of the sons' social classes, conditional on the father's, then you can just do
        Code:
        tab class_son class_father, col

        Comment


        • #5
          Hi Clyde

          The tabulate function is what I did as well.
          Regarding youur statement: Yes the father can be the same person (e.g. can have more than one son), but within a family it can also be that 3 fathers (which are brothers) have again 3 sons each. (These cases are unambigious modelled with personal ID's for each person). But YES it is true that one person can be part of more than one father-son combination. Since he can has more than one son and my data set covers more than two generations (e.g. it could be that MY grandfather my father and myself are in the dataset, what would lead to two father-son combinations; My grandftaher-my father and my father and myself). It is thought that I should construct a Markov proceess for this case. But don't know how to build matrices..

          Comment


          • #6
            I added this disclaimer to the description of markov in 2011:

            Note added 2011: This is a small and
            limited program from 1998 that just does what it says, and no
            more. For example, it does not support panel data, or modelling
            with predictor variables, or do almost anything else you might
            want to do with Markov chain models.

            More positively, see Austin Nichols' survey at http://www.stata.com/meeting/boston1...14_nichols.pdf

            Comment


            • #7
              How do I estimate Intergenerational mobility using transitional probability matrix. Is there any book that can aid me with an in-depth explanation?

              Comment


              • #8
                Dear Professor Schechter, I very agree wiht your suggestions! Could we manage to let the probability of rows and cols both sum up to one? Thank you a lot in advance!

                Code:
                  
                 tab  class_father class_son, row nofreq

                Comment

                Working...
                X