Announcement

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

  • Formatting for marker labels

    Hello,
    I am using a graph to indicate trends in test scores over time. Test scores are at the year level. In 2004, the format of the test changed, and I would like to indicate that in my graph. However, in defining my marker label value, I am use an asterisk in (*) to indicate levels that are significantly different from the base year. I therefore need to another way to indicate that 2004 (and the years after) reflect a different test format. These values could be bolded, italicized, or have a subscript after them to indicate that they are a different test format. I have not seen anything that allows one to do that in marker label values (though I have seen tips on how to bold, italicize, etc., text in graph titles). If anyone has any suggestions, I would appreciate it. The relevant portions of my code are included, where boys' reading scores are plotted against the var "nmfrl9". Thank you.
    Christina

    // Generate labels for graphs
    label define boyread 1971 "1971" 1980 "1980*" 1984 "1984*" 1990 "1990" 1992 "1992" 1994 "1994*" 2004 "2004*" 2008 "2008*" 2012 "2012*"

    // Graph
    twoway (scatter boyread9 nmfrl9, msymbol(oh) mlabel(boyreadyear) mlabsize(small) mlabv(pos) mcolor(purple) mlabcolor(purple)) ///
    (lfit boyread9 nmfrl9, lcolor(black) lwidth(vthin)) ///
    ytitle("NAEP scores", size(small)) xtitle("") xscale(range(.05 .35)) xlabel(.05 ".05" .1 ".10" .15 ".15" .20 ".20" .25 ".25" .30 ".30" .35 ".35", labsize(small)) ///
    ylab(200(10)250, labsize(small)) yscale(r(200 250)) ///
    note("Panel A: Boys", pos(11) size(*1.05) color(black*2) ring(-1)) xsize(7)

  • #2
    You can separate your outcome variable and/or your marker label variable. Once you do that, you can use different representations for each.

    SJ-5-4 gr0023 . . . . Stata tip 27: Classifying data points on scatter plots
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N. J. Cox
    Q4/05 SJ 5(4):604--606 (no commands)
    tips for using separate, gray-scale gradation, and text
    characters as class symbols to classify data points on
    a scatter plot

    More at http://www.stata-journal.com/sjpdf.h...iclenum=gr0023

    Suggestions:

    1. Space is likely to be your scarce resource, so shorter marker labels such as

    Code:
    label define boyread 1971 "71" 1980 "80*" 1984 "84*" 1990 "90" 1992 "92" 1994 "94*" 2004 "04*" 2008 "08*" 2012 "12*"
    might be worth the small extra effort you're asking of your readers.

    2. Unless nmfrl9 is a time variable, connecting your data points in time order might help too.

    Comment


    • #3
      Thank you - I was obviously using the wrong search terms, so I appreciate being directed towards documentation.

      But I am still struggling to distinguish the pre 2004 values from the 2004 and onward values. Is there a way to make the >= 2004 values bolded, italicized, or underlined?

      Comment


      • #4
        You can do any or all of that. In particular. SMCL directives work here.

        Code:
        . sysuse auto, clear
        (1978 Automobile Data)
        
        . scatter price weight if foreign, xsc(log) ysc(log) mla(make)
        
        . gen make2 = "{it:" + make + "}"
        
        . scatter price weight if foreign, xsc(log) ysc(log) mla(make2)
        In your case you want to change some values, not all, but you know how to do that. Use different mark-up for bold or underlined.

        Comment


        • #5
          Thank you for posting again, and answering my question.

          Comment

          Working...
          X