Announcement

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

  • how to understand the equal sign underlied? why we need to put it in the double quotes?

    Dear, I am new to Stata. Thank you for your help. These days, I am reading the programming books, and encounter the following syntax. I do not understand why we need to put the equal sign (I have already signed it) in the double quotes. In other words, when shall we put it in the double quotes and when not.

    global y "consume"

    global x "gdpper real_i rategap ss depend bank_w"

    reg $y $x
    est store c1

    reg $y $x fix*
    est store c2
    ereturn list

    global mm "c1 c2"

    dis "Dependent = " in y "$y"

    esttab $mm, b(%6.3f) star(* 0.1 ** 0.05 *** 0.01)///
    scalar (r2 r2_a F N)
    compress nogaps
    order($x) drop(*fix*)
    mtitle (OLS FE)

    Best

    Thank you again


  • #2
    Can we write like this

    dis "Dependent" in y "$y"
    or
    dis "Dependent" = in y "$y"

    Comment


    • #3
      Unless you are using a very old version of Stata, the -in y- part of your -display- commands will just be ignored. It does not provoke a syntax error, but displaying in yellow is no longer supported.

      With regard to your actual question, the equals sign is just like any other character in the display commands you show. If it is not included within the quotation marks, it will not be printed. The only other use of an equals sign in a -display- command is that it can be used to force evaluation of a numeric expression. But in that use, it is still not printed. The only way to get an equals sign printed is to included it within quotation marks.

      Comment

      Working...
      X