Announcement

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

  • #16
    sepscatter can't subvert the limits of graph twoway. Here is what help limits tells you.

    Code:
     graph twoway
           # of variables in a plot                 100                100
           # of styles in an option's stylelist      20                 20
    What is 50+? 60? 500? Don't you know? Let me guess 66.

    If you had a menu of 66 different symbols it couldn't help. You'd lose much of your space to legend. I have to guess that showing 66 patients identifiably in one graph using marker symbols is doomed.

    66 numeric identifiers 1 to 66 shown as marker labels would look a mess, but there are worse messes imaginable.

    I'd check out fabplot (SSC). It is not there yet, but I am pondering a set-up in which you could show say 7 or 8 patients (in your case) in each panel, with identifiers for each, and so say 9 panels in the display. For each panel, you show the other series as backdrop.

    There is software that lets you click on a series and up pops the identifier. Stata doesn't do that and oddly or not I have not heard it being asked for.

    Comment


    • #17
      Thank you very much for your recommendations and direction. You wouldn't believe it, but I have 66 exactly! We may be adding more (1-10) as the year goes on, though I can create subsets of the sample for increased clarity in reporting.

      Comment


      • #18
        We experienced users have ways of finding these things out. Or not. An extension to fabplot is something I want to look into any way. Don't hold your breath, but that might even be easy once I wrap my head around the problem.

        Comment


        • #19
          Hi there!

          Thanks for this feature Nick!

          I have a question: I want to separate the scatter for various 2-digit industries. But the markers should be the same for a main group of industries. For example, there should be one spot each for Agriculture, Fishing and Mining, but they all should have the same symbol as they all refer to the Primary sector. The legend should also show "X = Primary Sector".

          Click image for larger version

Name:	Bildschirmfoto 2021-08-22 um 10.24.43.png
Views:	1
Size:	39.7 KB
ID:	1624398



          Does someone know how to do that using the sepscatter command?

          Thanks a lot!

          Comment


          • #20
            You just need to spell out what you want in the msymbol() option. twoway doesn't object if you want the same symbol for different variables.

            This works, for example:

            Code:
            . sysuse auto, clear
            (1978 automobile data)
            
            . sepscatter mpg weight, sep(rep78) ms(X X Oh Oh Oh)

            Comment


            • #21
              Thanks Nick!

              Comment


              • #22
                Hello Nick Cox I have a question similar to what Cathrin Bruckmann asked above.

                I would like to have a scatterplot with country names indicated beside each dot and different color/shape based on whether the country is in OECD or not.

                I used the following:
                sepscatter inflation gdppc, ms(country) sep(oecd) xline(0,lp(dash)) yline(0, lp(dash) lcol(black)) xlabel(-50(10)100)
                It produces the following results:
                Click image for larger version

Name:	Screenshot 2021-08-28 at 23.29.42.png
Views:	2
Size:	62.1 KB
ID:	1625240



                However, I would like each dot to have the country name besides it.

                The following is my data.

                Code:
                * Example generated by -dataex-. To install: ssc install dataex
                clear
                input str9 country float(gdppc inflation) str8 oecd
                "CZE"  40.49 -16.51 "OECD"    
                "EST"   20.1  17.25 "OECD"    
                "HUN"  27.03 -17.18 "OECD"    
                "SVN"   6.05 -47.42 "OECD"    
                "CYP" -36.98 -43.49 "NON-OECD"
                "HRV" -32.34 -33.62 "NON-OECD"
                "BGR"  24.36 -18.73 "NON-OECD"
                "ROU"  32.22 -52.23 "NON-OECD"
                end
                Your assistance will be greatly appreciated.
                Thanks as always to Kit Baum, a new program sepscatter is available from SSC, to be installed using ssc inst sepscatter. As usual, the help file gives the

                Comment


                • #23
                  You got a warning message with that syntax that you don't report.

                  This should help.

                  Code:
                  sepscatter inflation gdppc, mla(country country) sep(oecd) xline(0,lp(dash)) yline(0, lp(dash) lcol(black)) xlabel(-50(10)100)

                  Comment


                  • #24
                    Nick Cox I am deeply grateful for you prompt help.

                    Comment

                    Working...
                    X