Announcement

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

  • Assistance with troubleshooting code

    Hello Statlist Colleagues:

    I am working on replicating code to make the figure on page 26 of this slide deck with my variables of interest: https://www.princeton.edu/~otorres/Panel101.pdf


    Below is the code I used:
    Code:
    twoway scatter economic_freedom_summary_index year, msymbol (circle_hollow) color(gs14) || ///
        connected mean_economicfree year, msymbol(diamond) sort ///
                ylabel (0(1)10, angle(0) labsize(2) format(%7.0fc)) ///
                xlabel (2006(1)2018, angle(45) labsize(2) grid) ///
                title(Economic Freedom) xtitle(Year, size (2.5)) ///
                legend(label(1 "Economic Freedom per country") label(2 "Mean Economic Freedom per year"))
    When I modify the code from the slide deck, I get the following error in the output:
    Attached Files
    Last edited by Diana Hechavarria; 20 Mar 2023, 16:12.

  • #2
    I realized I should have shred an image of the figure I was trying to produce in the original post.
    Click image for larger version

Name:	Screen Shot 2023-03-20 at 5.19.21 PM.png
Views:	3
Size:	548.6 KB
ID:	1706362
    Attached Files

    Comment


    • #3
      The code is not robust to the spaces that you introduce between ylabel/xlabel and the opening parenthesis.

      Code:
      twoway scatter economic_freedom_summary_index year, msymbol (circle_hollow) color(gs14) || ///
          connected mean_economicfree year, msymbol(diamond) sort ///
                  ylabel(0(1)10, angle(0) labsize(2) format(%7.0fc)) ///
                  xlabel(2006(1)2018, angle(45) labsize(2) grid) ///
                  title(Economic Freedom) xtitle(Year, size (2.5)) ///
                  legend(label(1 "Economic Freedom per country") label(2 "Mean Economic Freedom per year"))

      Comment


      • #4
        Thank you Andrew Musau ! I appreciate your help so much!

        Comment

        Working...
        X