Announcement

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

  • Displaying significance level in line graphs of coefficients

    When plotting multiple line graphs of coefficients with their respective confidence intervals (with twoway rbar, for example), the graph can get too crowded depending on the size of the CIs.

    I'm wondering if it's possible to place special markers on points of the line graph that depicts statistically significant (different from zero) coefficients. So, imagine coefficients plotted as a line graph (without CIs), and if the coefficient is significant, there's a symbol such as a triangle or diamond instead of just the line.

    Has anyone ever heard of something like that in Stata?

    A small example would be this graph, without the CIs, and the red diamonds indicate the statistical significance:
    Click image for larger version

Name:	image_8626.png
Views:	1
Size:	71.3 KB
ID:	1513577
    Last edited by Joao Pugliese; 23 Aug 2019, 13:36.

  • #2
    Here is one way using Roger Newson's parmest (ssc inst parmest):

    Code:
    webuse grunfeld,clear
    
    reg kstock ibn.year, nocon
    parmest, norestore
    gen year = real(substr(parm, 1,4))
    twoway connected  estimate year  /// 
     || scatter estimate year if p < .05 , ms(D) msize(*2) mcolor(red) /// 
     ||, legend(off)
    Click image for larger version

Name:	Graph.png
Views:	3
Size:	25.1 KB
ID:	1513592

    Comment


    • #3
      Hi Scott, thank you for your answer. It worked perfectly.

      For others with the same question as I had: the trick is to use the scatterplot graph with a collapsed dataset. As Scott mentioned, the parmest command collapses the dataset to store the values of the parameters according to each variable (in his example, "year"). But you can also, instead of using parmest, just collapse the dataset keeping the coefficient values by the specific variables you want to plot.

      Comment


      • #4
        Hi Scott, Thank you for your suggestion which is very nice using twoway plot. However, is there any way to implement the similar idea in radar plot using 'radar' code in Stata. It can be installed using ssc install radar

        Comment


        • #5
          https://www.nature.com/articles/d41586-019-00857-9

          Comment

          Working...
          X