Announcement

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

  • #16
    I can't see how any functions are relevant here, but perhaps other options are closer to what you want. With your data example, I go


    Code:
    su vol if marr==1, meanonly 
    local max = r(max)
    su p_vol if marr==1, meanonly 
    local max = max(`max', r(max)) 
    
    tabplot vol p_vol if marr==1, showval bfcolor(green*0.2) yasis xasis legend(cols(1)) scheme(s1color) ///
    ytitle(Total Hours/Mins) title(Vol (hrs/mins:marr), size(medsmall)) ///
    xtitle(Total Hours/Mins) yla(0/`max') xla(0/`max') aspect(1) name(vol_marr, replace)
    to get this

    Click image for larger version

Name:	boulis.png
Views:	1
Size:	21.2 KB
ID:	1533412

    Comment


    • #17
      Thank you Nick Cox. That is appreciated. A key issue is that I have a very large dataset and whilst most values fall between 0-20, there are still a lot of observations much larger, some above 100, and this large range in values makes my graph to look very messy. I have attached a copy of this graph so you can see what I mean. Is there a way of dealing with this so the graph is more presentable? Would it be reasonable to show the median instead of the mean? (I updated the y/x titles to show hours only). I appreciate any help.

      Regards, Chris
      Click image for larger version

Name:	vol_marr.png
Views:	1
Size:	89.1 KB
ID:	1533661

      Comment


      • #18
        I think you just need to group some of the higher values together, or use a different design.

        Comment


        • #19
          Thanks Nick Cox. Yes grouping the higher values seems like a good idea. Do you mind elaborating on potential different designs that I may consider.

          Kind regards, Chris

          Comment


          • #20
            Perhaps a scatter plot using square root scales (to accommodate the zeros) and transparency.

            Comment


            • #21
              Thank you Nick Cox. I will look into this.

              Comment


              • #22
                With regards to tables: I have generated four tables (using tabulate) on the same categorical variable. For example, the quantity of cars in a country by make and age. The first tabulation shows cars by make made pre-1980, the second shows cars by make made between 1980 and 2000, the third shows cars by make between 2000 and 2017 and the last tabulation shows the total cars of each make. Is there a way to create a table that combines the frequency/percent of each of the four separate tabulations?

                Regards, Chris

                Comment


                • #23
                  Hi Nick Cox. Can you please explain what you mean by 'transparency' in #20? Regards, Chris

                  Comment


                  • #24
                    see
                    Code:
                    help colorstyle
                    and scroll down to the section on "adjust opacity"

                    Comment


                    • #25
                      Thanks Rich Goldstein.

                      Comment

                      Working...
                      X