Announcement

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

  • Graph Options and their rationales

    So for a program I'm writing, I learned how to pass user-specified graph options to graphs that are made by the estimator itself. And I learned (well, rediscovered, I already knew it) that you can have multiple graph reference lines. So it made me wonder "Oh that's pretty cool, let's try and extend this elsewhere". Let's load the West Germany dataset for illustration. Note that I use labvars from ssc, but it doesn't matter here.
    Code:
    u "http://fmwww.bc.edu/repec/bocode/s/scul_Reunification.dta", clear
    loc int_time = 1990
    cls
    qui xtset
    local lbl: value label `r(panelvar)'
    
    
    loc unit ="West Germany":`lbl'
    
    g treat = cond(`r(panelvar)'==`unit' & `r(timevar)' >=`int_time',1,0)
    
    
    labvars gdp treat "GDP per Capita" "Reunification"
    
    loc int_timerel= `int_time'-1
    
    tsline gdp if `r(panelvar)'==`unit', ///
    tline(`int_time') ///
    tline(`int_timerel') ///
    note("Here's one note") ///
    note("Here's another one")
    We see that we can have multiple reference lines. But why can't we have more than one note? Why can't we have multiple captions? Why does Stata prefer the latter note to the first one? It isn't a big deal, because I'll just use programmers if , if the users specify their own graph options, but either way, I'm curious why Stata is cool with multiple reference lines, but not more than one note. Is there a reason for this?

  • #2
    You are alluding to the notion of a line break in the graph note, in which case consider

    Code:
    note("Here's one note" "Here's another one")

    Comment


    • #3
      Why does Stata prefer the latter note to the first one?
      An answer to that question, and perhaps others, may found in the output of
      Code:
      help repeated options
      and the corresponding section of the Stata Graphics Reference Manual PDF.

      Changing the final command in post #1 to
      Code:
      note("Here's another one", suffix)
      produces two lines of notes.
      Click image for larger version

Name:	Untitled.png
Views:	1
Size:	22.7 KB
ID:	1679085
      Last edited by William Lisowski; 24 Aug 2022, 07:36.

      Comment


      • #4
        Changing the final command in post #1 to
        Oh. That's cool! Had no idea this existed before, thanks so much!

        In my pre-LaTEX days, I would use line breaks, but I always hated how the note would be a little too long for the graph, and I'd have to tinker around with where the next line would begin, but either way, this works.

        Comment

        Working...
        X