Announcement

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

  • Graph transparency with Stata14

    Hi all,

    I want to plot on the same graph the effect of a predictor for both conditional and unconditional quantile regression. Therefore, after having stored the coefficient for each quantile for both models, I am using the following code:

    Code:
     twoway rarea _lb_uqr _ub_uqr q, color("eltblue")  fintensity(5) || rarea _lb_cqr _ub_cqr q,color("red") fintensity(5) yline(0) || line _b_uqr q || line _b_cqr q,  ///
    legend(order(1 "95% confidence interval (UQR)" 2 "95% confindence interval (CQR)" 3 "UQR effect" 4 "CQR effect") cols(1))  ytitle(effect of social origin)  ylab(,angle(0) format(%7.0gc))  xlab(10(10)90) xtitle(percentile of log-income)
    This is the output:

    Click image for larger version

Name:	cqr-uqr .jpg
Views:	1
Size:	399.5 KB
ID:	1576839



    Although I can graph quite nicely the overall-effect, the confidence interval overlaps too much and I do not know how to make them transparent in Stata14. I am aware that for recent versions can be used the % symbol within the color option, is there a way to make the confidence intervals transparent and clearly visible (and therefore also the yline(0) perfectly visible too)?

    Thanks!

  • #2
    Dear Luca,

    I suppose the obvious answer is that you should better upgrade to Stata 16.1, as that offers many benefits in the graphing functionality department, as well as many other improvements.
    (I do not have any commercial interest!)

    Best,
    Eric
    http://publicationslist.org/eric.melse

    Comment


    • #3
      Eric is correct, graph transparency was added as a feature in Stata 15 (-help whatsnew14to15-), so an upgrade is required to use opacity. In your case, you can produce two separate panels to show each line and confidence band separately as a workaround.

      Comment


      • #4
        Thanks both for the comments. Yes, I was aware of the new graphical effects in upgraded version, I was still hoping there was a way to do that even with Stata14. Thanks anyway

        Comment

        Working...
        X