Announcement

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

  • How to obtain marginal effect after FMM?

    Hi Statalisters,

    I want to know how to use the margins command to obtain marginal effect for the multinomial logit part. Take the codes below for example, I want to calculate marginal effect of the variable "exposure" in the first output table as attached.

    Code:
    clear all
    set more off
    webuse rod93
    fmm 2, lcprob(age_mos exposure): poisson deaths age_mos exposure i.cohort


    Thank you


    YY
    Last edited by Yanyu Sun; 01 Dec 2017, 19:13.

  • #2
    I can see your output table, but based on your statement and your code, perhaps this is what you want.
    Code:
    clear all
    set more off
    webuse rod93
    fmm 2, lcprob(age_mos exposure): poisson deaths age_mos exposure i.cohort
    margins, dydx(exposure) predict(classpr class(1))
    margins, dydx(exposure) predict(classpr class(2))
    Best.

    Partha

    Comment


    • #3
      Thank you, Professor Deb! That's what I want

      Thank you for your work on FMM. I find it useful! By the way, do you know where I can find more examples of FMM in Stata 15 besides the official FMM document from Stata. I have read your slides in previous years and did not find new ones incorporating the Stata 15 FMM.

      Comment


      • #4
        Sure thing. I'm learning about -fmm- in Stata 15 myself -- many possibilities and options so a lot to learn and digest.

        Comment


        • #5
          You definitely should write a book on it. I will buy it

          Comment


          • #6
            Hello. I had a question regarding this topic. It's the first time I post, so, although I've read the FAQ section, I don't know if it's the right way to do it. The objective in my case would be to estimate the marginal effect of an independent variable not included as a variable for class probabilities. Applying the syntax above I cannot estimate anything:
            Code:
            clear all
            set more off
            webuse rod93
            fmm 2, lcprob(age_mos exposure): poisson deaths age_mos exposure i.cohort
            Margins, dydx (cohort) predict (classpr class (2))
            After reading the Stata manual I think the correct syntax would be the following:
            Code:
            clear all
            set more off
            webuse rod93
            fmm 2, lcprob(age_mos exposure): poisson deaths age_mos exposure i.cohort
            Margins, dydx (cohort) predict (class (2))
            With this second syntax I can get results. The question would be, are these results correct? Am I correctly estimating the marginal effects of the cohort variable? I am using Stata 15.0 and my real model is a probit one
            Thanks in advance

            Comment


            • #7
              Hi Israel
              I think your syntax is correct, but perhaps the objective is not.
              If Cohort is not part of the class probability, then by default, the effect is zero.
              You may obtain something there, however, only through the nonlinearities of the system, but I don't think it makes much sense to do that. Perhaps you need to re-state your question?
              F

              Comment


              • #8
                Many thanks for your diligent response. The main question is if once I have predicted the membership of each of the two classes from age_mos and exposure, is it possible to know the marginal effect that cohort has on the death variable?
                I

                Comment


                • #9
                  That is an interesting question.
                  Since its part of your poison, it should. What Im uncertain is if you can produce a single effect (average across all mixture models), or if the only solution is to produce effects for each class.
                  I think your first step there is define, how would the marginal effect look like?

                  Right now"
                  Death = F1(age_mos ,exposure ,i.cohort) with P1
                  Death = F1(age_mos ,exposure ,i.cohort) with P2
                  So is the effect on Death equal to ?:
                  dDeath/Dcohort = dF1/dCohort * p1 + dF2/dCohort * p1

                  This is probably in the manual, but it is important to understand what is it you are trying to capture.

                  Comment

                  Working...
                  X