Announcement

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

  • Histograms and step function graphs in one figure

    Hi
    I am using Stata 15. My data is a panel data set for 300 districts from 1980 to 2015. I have three variables crop YIELD (in kg per hectare), TEMPERATURE (in degree Celsius), and EXPOSURE (number of days that the temperature was of a certain degree ).
    I am trying to replicate a graph that shows the relation between temperature and yields in the ‘upper panel’ and a histogram of temperature and number of days in the ‘lower panel’.
    The replication is from the following paper Schlenker and Roberts (2009) (https://www.pnas.org/content/pnas/106/37/15594.full.pdf) and the graph looks as follows.
    Initially I thought it could be something like


    Click image for larger version

Name:	Untitled.png
Views:	1
Size:	55.3 KB
ID:	1535073

    Initially I thought it could be something like

    Code:
    graph twoway (bar TEMPERATURE EXPOSURE) (line TEMPERATURE YIELD, lc(black))
    But evidently this is not even close to what i am supposed o be doing. Additionally the study mentions that the graphs in the upper panels are "based on regressions", so I am not sure how to start plotting them.
    Any suggestions?

  • #2
    In help graph combine there is an example on how make such a graph
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Not the question, but I find it alarming that an eighth-order polynomial was found a good idea by authors and reviewers alike.

      Full confession: I have not read the linked paper. But I would expect a function with a maximum yield at some intermediate temperature -- and wouldn't be surprised at asymmetry: plants die or wither at extremes. Anything else looks like overfitting.

      Comment


      • #4
        Maarten Buis Thank you for the reference to help graph combine. I am looking it up now.
        Nick Cox Thank you. Sorry I didn't mention it but I propose to ditch the 8th order polynomial in favor of a quadratic one and the step function.

        Comment

        Working...
        X