Announcement

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

  • graph: quantile regression coefficients - xtrifreg command

    Dear all,

    Can you help me with the code to create a graph of the quantile regression coefficients using the xtrifreg command?
    Thank you in advance.

    Best regards

  • #2
    Hi Ana, it all depends on your customized preference. Here's my sketchy example for your reference:
    Code:
    clear all
    forvalues i=10(10)90{
      local j `j' temp`i'
    }
    tempfile `j'
    
    forvalues i=10(10)90{
      qui sysuse nlswork,clear
      qui xtrifreg ln_wage union, fe i(idcode) q(`i')
      drop *
      cap mat drop b
      mat b=e(b)'
      svmat b
      gen q=`i'
      mata: var=("union","cons")'
      getmata name=var,replace
      save temp`i',replace
    }
    clear 
    forvalues i=10(10)90{
      append using temp`i'
    }
    tw (line b1 q),by(name) xlabel(10(10)90) ytitle(coef) xtitle(quantile)
    2B or not 2B, that's a question!

    Comment

    Working...
    X