Announcement

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

  • Scatter plot

    Hello,

    I have a question regarding the scatter plot (Fitted line), Actually, I have 60 countries and two points of time for each country (e.g Mexico 2006 and 2010). how I can do it (I should take the country averages)? Can you help me with the coding of this graph

    Thanks a lot

  • #2
    It depends on what you exactly want to show. So can you tell us more about the variables you want to plot, what the purpose if that plot is, what is the "story" that it is supposed to tell?
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Thanks for your reply,

      I have Y(y1= Finance constraint; y2 = formal credit; y3 = informal credit) and x (= Trust in people), So I want to show for each variable of y just the correlation between them and to see what are the top and bottom countries for this relationship and after to see for which kind of finance they have a strong relationship for these countries.

      Thanks

      Comment


      • #4
        Here are two options:

        Code:
        clear
        use https://www.rug.nl/ggdc/docs/pwt90.dta
        
        keep if inlist(year, 2006, 2010)
        
        gen gdppc = rgdpe/pop
        
        // basic graph
        scatter gdppc hc, by(year) name(basic, replace)
        
        // nicer graph (in this case it makes sense to use a log scale for gdp per capita)
        scatter gdppc hc, by(year, note("")) ///
            yscale(log) ylab(5e2 1e3 5e3 1e4 5e4 1e5, format(%9.0gc)) ///
            mlabel(countrycode) mlabpos(0) msymbol(i)
        There are lots of things you can do with graphs in Stata, see for example the materials on a graphics workshop I gave at the last German Stata Users' meeting : http://www.maartenbuis.nl/workshops/
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment

        Working...
        X