Announcement

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

  • Estimating Elasticities for Different Quantiles using mmqreg and margins

    Dear Stata Community,

    I am trying to estimate elasticities at different quantiles of my dependent variable using the mmqreg command. My dependent variable is non-negative, has a mass at zero and is highly skewed. I want to avoid applying a log transformation and adjustment to the dependent variable, but I am unsure how to implement the elasticity calculation in this context.

    Below is the code I am currently using:

    HTML Code:
    local quantiles  0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
    
    foreach q of local quantiles {
    
        mmqreg y log_x c.z##c.z##c.z, absorb(id time) cluster(id) quantile(`q')
    
        local temp = `q' * 100
        _pctile log_x, p(`temp')
        local log_x_p`temp' = r(r1)
    
        _pctile z, p(`temp')
        local z_p`temp' = r(r1)
    
        margins, eydx(log_x) at(log_x = `log_x_p`temp''  z = `z_p`temp'') post
    }

    My questions are:
    1. Is this a valid approach for estimating elasticities at different quantiles with the mmqreg command?
    2. Is there a better way to handle skewed data with mass at zero for estimating elasticities without log-transforming the dependent variable?
    3. Am I correctly implementing the use of margins and percentiles in this context?
    Any suggestions on how to improve this process would be greatly appreciated!

    Thank you for your time and help.
Working...
X