Announcement

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

  • How to change the names of models in coefplot?

    In the example below, I would like to change the model names from "m1 and m2" to something else. I've tried using eqrename and eqlabels with no luck.

    HTML Code:
    drop _all
    clear all
    
    sysuse auto
    
    reg price mpg weight
    eststo m1
    
    reg price mpg weight length
    eststo m2
    
    #delimit ;
    coefplot m1 || m2 ,
    keep(mpg weight)
    bycoefs
    labels
    coeflabels(mpg = "Miles Per Gallon")
    eqlabels(m1 = "Model 1" m2 = "Model 2")
    ;

  • #2
    coefplot is from Stata Journal (FAQ Advice #12).

    Code:
    ylabel(1 "Model 1" 2 "Model 2")
    in place of

    Code:
    eqlabels(m1 = "Model 1" m2 = "Model 2")

    Comment


    • #3
      Thank you!

      Comment


      • #4
        Originally posted by Andrew Musau View Post
        coefplot is from Stata Journal (FAQ Advice #12).

        Code:
        ylabel(1 "Model 1" 2 "Model 2")
        in place of

        Code:
        eqlabels(m1 = "Model 1" m2 = "Model 2")
        Dear Andrew,

        Is there a way to change names of models from horizontal to vertical format?

        Update: It seems I found the solution. I think add angle(45) to xlabel would to what I want.

        Thank you.
        Last edited by Matthew Williams; 13 Apr 2023, 10:16.

        Comment

        Working...
        X