Announcement

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

  • Calculating Margins to Interpred Ordered Logit

    Hi Statlisters,

    I am estimateing an ordered logit model within my panel data set. Code is

    Code:
    xtset ID year
    xtologit y age x2 x3 x4, vce(cluster z3)
    y is a categorical variable going from 1-4.

    In order to then interpret the results I do

    Code:
    margins, at(age=(0(10)100))
    But it just keeps calculating and calculating. I suspect that the issue is that age is continuous and not (0,1). Is this in fact the issue? How can I interpret my ordered logit when I have continuous regressors?

    Many thanks.

  • #2
    The fact that age is continuous and not 0, 1 is not the problem. There is nothing wrong with the code you show. You are just ordering a ton of calculation and it is taking a long time. With random effects models even a single margin take a long time to calculate because the random effects have to be estimated (which, is itself time consuming)., and then calculations applied into every observation. The bigger your data set, the longer it will take. And you have asked for not 1 but 44 such calculations. So find something to occupy yourself with for several hours, and be patient. Stata isn't going to output any of the results until all of them are done--it's going to be a long wait.

    But here's another thought. If we are dealing with humans in this study, the age range from 0 to 100 is pretty unrealistic. There are very few things that one could observe about humans that make sense throughout the life cycle from birth until becoming a centenarian. Do you really need results over that entire range of ages? If it's a study of adults, maybe just run ages from 20 to 80? That'll eliminate 16 of the 44 margin calculations (over a third of them) and you probably won't lose any useful information from doing that.

    Comment


    • #3
      Originally posted by Clyde Schechter View Post
      The fact that age is continuous and not 0, 1 is not the problem. There is nothing wrong with the code you show. You are just ordering a ton of calculation and it is taking a long time. With random effects models even a single margin take a long time to calculate because the random effects have to be estimated (which, is itself time consuming)., and then calculations applied into every observation. The bigger your data set, the longer it will take. And you have asked for not 1 but 44 such calculations. So find something to occupy yourself with for several hours, and be patient. Stata isn't going to output any of the results until all of them are done--it's going to be a long wait.

      But here's another thought. If we are dealing with humans in this study, the age range from 0 to 100 is pretty unrealistic. There are very few things that one could observe about humans that make sense throughout the life cycle from birth until becoming a centenarian. Do you really need results over that entire range of ages? If it's a study of adults, maybe just run ages from 20 to 80? That'll eliminate 16 of the 44 margin calculations (over a third of them) and you probably won't lose any useful information from doing that.
      Hi Clyde!

      Many thanks for your reply. I will run the commands and limit my age from 20 to 70 (there are only a couple of observations over the age of 70). Thank you for this.
      On another note: I have another continuous variable where I want to run margins for. However, that is income, so it ranges from around 0-100 and also includes numbers with decimals.
      Am I right to assume that there will be no way to calculate the margins, as there would be simply too many individual margin calculations? Many thanks!

      Comment


      • #4
        On another note: I have another continuous variable where I want to run margins for. However, that is income, so it ranges from around 0-100 and also includes numbers with decimals.
        Am I right to assume that there will be no way to calculate the margins, as there would be simply too many individual margin calculations?
        Of course you can calculate the margins. You just have to be prepared to wait a long time for the results. You can perhaps shorten the time by doing something a bit more coarse-grained than (0(10)100). Maybe (0(20)100) is good enough fro your purposes?

        Comment

        Working...
        X