Announcement

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

  • Marginal effects after ologit with original and log-transformed variable

    Dear Statlists,

    I ran an ordered logit regression using Stata17 on Windows 10, where the model contains both the original variable (milk_quantity) and a log-transformation of the corresponding variable (ln_milk_quantity).

    This is my model:
    Code:
     ologit count_adopt i.gender i.under35##i.Successor c.milk_quantity c.ln_milk_quantity, vce(robust)
    Now I want to calculate the marginal effects of the variable milk_quantity. For this, milk_ quantity and ln_milk quantity must change together.
    In the book by Long & Fresse 2014: Regression Models for Categorical Dependent Variables Using Stata, there is a suggestion on page 377, on how to compute the marginal effects in this case:
    "The only solution is to compute the appropriate predictions, specifying both the values of age and age-squared at two values of age and then subtracting the predictions."

    I tried to calculate this on the given example but failed.

    Is there anyone who knows how to code this in Stata?
    Any help is appreciated.


    Thanks Christian





  • #2
    you could use f_able (install from ssc)
    Code:
    webuse fullauto
    ssc install f_able
    fgen logmpg=log(mpg)
    ologit rep77 foreign length mpg logmpg
    ** you indicate which variable was created here logmpg, and add the option "auto"
    f_able logmpg, auto
    ** obtain margins as usual
    margins, dydx(mpg)

    Comment


    • #3
      Or compute the derivative and use the -expression()- option of margins.

      Comment


      • #4
        Thank you, Fernando! That works great.

        Comment

        Working...
        X