Announcement

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

  • How to make bigger graph

    Hello,

    I've been trying to visualise different effect of IV on DP for certain subgroups in used dataset. I've used this code:

    Code:
    graph twoway scatter DP IV, msymbol(Oh) || lfit DP IV, lwidth(medthick) || , xlabel(-1(1)4, grid) ytitle("graph") by(variable name of the subgroup, legend(off) note(""))
    The problem is that when the process is done, the output sends 130+ "mini"graphs, because of multilevel structure of the data.

    I want to ask you, if you know how to make each graph bigger (so I can actually present the results) or if you can change the command to make 100+ single graphs (one for each cluster).

    Thank you for help.


    P.S.: I am including the output graph:

    Click image for larger version

Name:	graph.png
Views:	1
Size:	34.9 KB
ID:	1456637


  • #2
    For separate graphs, which seems the smart thing with this many categories, something like:

    Code:
    sysuse auto, clear
    keep in 1/3
    levelsof make, local(categories)
    cd "C:\whereyoudliketokeepyourgraphs"
    foreach category of local categories{
    graph twoway scatter price mpg if make=="`category'", title("`category'")
    graph save "`category'"
    }

    Comment


    • #3
      Thank you, it works great! But wouldn't you know or anyone else how to add a fit line to each graph? I've used the command you posted above:

      Code:
        
      levelsof GROUP, local(categories)
      cd "C:\dowloads"
      foreach category of local categories{
      graph twoway scatter IV DP if make=="`category'", title("`category'")
      graph save "`category'" }
      Last edited by Karel Novak; 05 Aug 2018, 05:29.

      Comment


      • #4
        Code:
        levelsof GROUP, local(categories)
        cd "C:\dowloads"
        foreach category of local categories{
        graph twoway (scatter IV DP if make=="`category'") (lfit IV DP if make=="`category'"), title("`category'")
        graph save "`category'" }

        Comment


        • #5
          Awesome. Thanks.

          Comment

          Working...
          X