Announcement

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

  • graphing histogram for panel data

    dears,
    I am working on panel data. My research focuses on fiscal consolidation.
    I want to graph histogram for (some of the observations 'zero' value and the others 'continuous'). I want to graph (two-way histogram between the size [the continuous value] and number of episodes) and (duration of the episodes and twoway graph with the years). can u suggest to me the STATA code?
    The figure below I take it from a published paper. I want to replicate it using my dataset.


  • #2
    Dear Andrew Musau

    Here is a draft data of ten countries. I want the STATA code for graphing the histogram for the size and duration of the episodes like the above two figures.
    Thanks
    Attached Files

    Comment


    • #3
      Originally posted by Gabriel Temesgen View Post
      The figure below I take it from a published paper. I want to replicate it using my dataset.

      I cannot see the figure that you refer to. Please refer to the FAQ Advice to upload figures in .PNG format (FAQ Advice #12).

      Comment


      • #4
        I got the figures from the paper (https://doi.org/10.1016/j.ecosys.2022.100981)

        Comment


        • #5
          If you are asking how they produced the following figure, they had 3 variables named "dcapb_weo_gdp", "dcapbhp" and "dcapbham", and two indicators, one for advanced economies and one for developing economies. For the top right-hand side figure, e.g., they simply ran

          Code:
          histogram dcapb_weo_gdp if advanced
          See

          Code:
          help histogram
          Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	93.3 KB
ID:	1664206

          Comment


          • #6
            The figure in #5 is forthcoming in a journal -- I don't know the journal concerned. It is an example of a graph that would be passed, I guess, by many reviewers as not only publishable but perhaps even praiseworthy.

            Yet I suggest that it is seriously flawed for many purposes and not at all exemplary.

            Insofar as interest focuses on subtle but presumably definite differences between categories, the reader is obliged to go back and forth between histograms in the same array to make comparisons. In principle, a great deal of detail is given. In practice, I challenge people here to say whether they find those comparisons easy and effective. I also object to the researchers telling us that outliers have been dropped. I'd rather be able to see for myself what is going on.

            Further, in the interests of using the available space, the ranges on each axis may differ, so the reader is expected to notice that and make comparisons knowing that. I say that this is too difficult a challenge.

            I would consider instead

            slightly smoothed density traces, superimposed

            or

            quantile plots, superimposed

            The device of front-and-back plots could be used if the results were too crowded. See https://journals.sagepub.com/doi/ful...6867X211025838 for a paper and https://www.statalist.org/forums/for...ailable-on-ssc for a long thread here that gives several examples (you may wish to skim and skip vigorously over early posts).

            That is, each category would be shown prominently in turn and the others shown collectively as a backdrop of curves.

            The normal distributions are presumably offered as reference distributions, That's fine by me, but there are other possibilities.

            What else the researchers did by way of analysis is not an issue. It's not in my view an exemplary graph.
            Last edited by Nick Cox; 12 May 2022, 02:48.

            Comment


            • #7
              Dear Andrew Musau, thank you for the suggestion. I am more with figure 3 in the paper (https://doi.org/10.1016/j.ecosys.2022.100981).

              Fig. 3. Strength and duration of consolidation episodes, full sample WEO-based CAPB, 1970–2018. Note: The budgetary position is measured by the CAPB (% of potential GDP); “improvement” is measured during the consolidation years of the episode identified.

              Comment


              • #8
                The figure on the left-hand side is a bar graph, and is such as

                Code:
                sysuse auto
                gr bar mpg, over(rep78)
                The one on the right-hand side is a histogram.

                Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	85.9 KB
ID:	1664260

                Comment

                Working...
                X