Announcement

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

  • Add legend using grqreg

    Hi,

    I want to add legend after running grqreg. the codes are
    . webuse auto, clear
    . sqreg price weight length foreign, quantile(.2 .4 .6 .8) reps(100)
    . grqreg weight, cons ci ols olsci

    After running this I want add legend below the graph of each line and 95% Conf. Interval

    Thanks and regards,

    Ariful

  • #2
    Use the -grqreg, saving()- option and construct the graphs by hand.

    Comment


    • #3
      Originally posted by Scott Merryman View Post
      Use the -grqreg, saving()- option and construct the graphs by hand.
      Hi Scott,

      I am extremely sorry that I can't figure out the code. Can you please help me what can be the probable stata code for adding legend.

      Comment


      • #4
        Originally posted by MD ARIFUL ISLAM View Post

        Hi Scott,

        I am extremely sorry that I can't figure out the code. Can you please help me what can be the probable stata code for adding legend.
        Hi MD, here is a code for your reference

        Code:
        sysuse auto,clear
        sqreg price weight length foreign, quantile(.2 .4 .6 .8) reps(100)
        grqreg, cons ci ols olsci save(temp)
        use temp.dta,clear
        tw (rarea weight_cihi weight_cilo qtile,sort col(gs13) fc(gs13)) ///
        (line weight qtile,sort), legend(order(1 "Coef" 2 "95% Interval"))
        2B or not 2B, that's a question!

        Comment


        • #5
          Originally posted by Liu Qiang View Post
          Hi MD, here is a code for your reference

          Code:
          sysuse auto,clear
          sqreg price weight length foreign, quantile(.2 .4 .6 .8) reps(100)
          grqreg, cons ci ols olsci save(temp)
          use temp.dta,clear
          tw (rarea weight_cihi weight_cilo qtile,sort col(gs13) fc(gs13)) ///
          (line weight qtile,sort), legend(order(1 "Coef" 2 "95% Interval"))
          Dear Liu Qiang,

          Thanks a lot. It works but I don't know why the final graph is coming only (0 .2 .4 .6 .8 1) quantile. I tried a lot but can't not make the Y axis (0.1 .25 0.50 .75 .90) quanlite. Do you have any idea- how can I solve it?

          Thanks and regards,

          Ariful

          Comment


          • #6
            Originally posted by MD ARIFUL ISLAM View Post

            Dear Liu Qiang,

            Thanks a lot. It works but I don't know why the final graph is coming only (0 .2 .4 .6 .8 1) quantile. I tried a lot but can't not make the Y axis (0.1 .25 0.50 .75 .90) quanlite. Do you have any idea- how can I solve it?

            Thanks and regards,

            Ariful
            Hi MD,
            you have to change the option in your -sqreg- to quantile(0.1 .25 0.50 .75 .90)
            2B or not 2B, that's a question!

            Comment

            Working...
            X