Announcement

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

  • Extra X point appears on graph

    Hello all,

    I have the attached data set that I use for a two-way graph.

    Although it is not in the data set, I get an extra data label on the x-axis. I could not eliminate it by putting limits on the axis with xscale(range(252 255).

    Why does this unwanted data label appear? What do you suggest I do?

    Here is my do file:

    gen Year_CYQ = qofd(EventDate)
    format Year_CYQ %tq
    collapse (sum) T_CallsOffered T_CallsAnswered, by(Year_CYQ)
    twoway (line T_CallsOffered Year_CYQ, sort lcolor(teal) lwidth(thick) cmissing(n)) ///
    (line T_CallsAnswered Year_CYQ, sort lcolor(dknavy) lwidth(thick) cmissing(n)), yscale(range(0 .)) yla(0(500) 6000) xscale(range(252 255))

    Thanks!
    Attached Files

  • #2
    This appears to be the entirety of your dataset -- thus zero need for an attachment, as dataex will suffice.

    * Example generated by -dataex-. For more info, type help dataex
    clear
    input long(YEAR T_CallsOffered T_CallsAnswered T_RouterCallsAbandQ T_TotalCallsAband) double Percent_Abandoned
    2023 21154 15581 2461 2622 12.394818946771297
    end

    But your code won't run with those data and you don't show a graph. So, I can't follow what you're asking.

    Comment


    • #3
      Sorry, Nick, Monday blues!

      Here is the data. I will post the do file after this:

      Code:
      * Example generated by -dataex-. For more info, type help dataex
      clear
      input double EventDate str7 Year_MO long(T_CallsOffered T_CallsAnswered T_RouterCallsAbandQ T_TotalCallsAband) double Percent_Abandoned
      23011 "2023 01"  1 0 0 0                  0
      23011 "2023 01"  1 0 0 0                  0
      23011 "2023 01"  2 0 0 0                  0
      23011 "2023 01"  1 0 0 0                  0
      23011 "2023 01"  1 0 0 0                  0
      23011 "2023 01"  1 0 0 0                  0
      23011 "2023 01"  1 0 0 0                  0
      23011 "2023 01"  1 0 0 0                  0
      23011 "2023 01"  1 0 0 0                  0
      23011 "2023 01"  1 0 0 0                  0
      23012 "2023 01"  1 0 0 0                  0
      23012 "2023 01"  3 0 0 0                  0
      23012 "2023 01"  1 0 0 0                  0
      23012 "2023 01"  1 0 0 0                  0
      23012 "2023 01"  3 0 0 0                  0
      23012 "2023 01"  4 0 0 0                  0
      23012 "2023 01"  2 0 0 0                  0
      23012 "2023 01"  3 0 0 0                  0
      23012 "2023 01"  1 0 0 0                  0
      23012 "2023 01"  1 0 0 0                  0
      23012 "2023 01"  2 0 0 0                  0
      23012 "2023 01"  2 0 0 0                  0
      23012 "2023 01"  2 0 0 0                  0
      23012 "2023 01"  5 0 0 0                  0
      23012 "2023 01"  1 0 0 0                  0
      23012 "2023 01"  3 0 0 0                  0
      23012 "2023 01"  1 0 0 0                  0
      23012 "2023 01"  1 0 0 0                  0
      23013 "2023 01"  1 0 0 0                  0
      23013 "2023 01"  1 0 0 0                  0
      23013 "2023 01"  6 6 0 0                  0
      23013 "2023 01"  3 2 1 1 33.333333333333336
      23013 "2023 01"  5 5 0 0                  0
      23013 "2023 01"  3 3 0 0                  0
      23013 "2023 01"  8 8 0 0                  0
      23013 "2023 01"  8 8 0 0                  0
      23013 "2023 01"  5 4 1 1                 20
      23013 "2023 01"  4 4 0 0                  0
      23013 "2023 01"  5 5 0 0                  0
      23013 "2023 01"  7 7 0 0                  0
      23013 "2023 01"  3 3 0 0                  0
      23013 "2023 01"  5 3 0 0                  0
      23013 "2023 01"  3 3 1 1 33.333333333333336
      23013 "2023 01" 11 8 0 0                  0
      23013 "2023 01"  4 7 1 1                 25
      23013 "2023 01"  4 4 0 0                  0
      23013 "2023 01"  5 4 0 0                  0
      23013 "2023 01"  1 1 0 0                  0
      23013 "2023 01"  1 0 0 0                  0
      23013 "2023 01"  1 0 0 0                  0
      23013 "2023 01"  2 0 0 0                  0
      23013 "2023 01"  1 0 0 0                  0
      23013 "2023 01"  1 0 0 0                  0
      23014 "2023 01"  1 0 0 0                  0
      23014 "2023 01"  3 0 0 0                  0
      23014 "2023 01"  6 6 0 0                  0
      23014 "2023 01"  4 3 0 0                  0
      23014 "2023 01"  5 3 3 3                 60
      23014 "2023 01"  5 4 1 1                 20
      23014 "2023 01"  4 4 0 0                  0
      23014 "2023 01" 10 4 2 2                 20
      23014 "2023 01"  5 7 2 2                 40
      23014 "2023 01"  3 3 0 0                  0
      23014 "2023 01"  8 6 1 1               12.5
      23014 "2023 01"  5 5 0 0                  0
      23014 "2023 01"  3 2 0 0                  0
      23014 "2023 01"  8 7 0 0                  0
      23014 "2023 01"  4 3 1 1                 25
      23014 "2023 01"  6 4 1 1 16.666666666666668
      23014 "2023 01"  3 3 0 0                  0
      23014 "2023 01"  4 4 0 0                  0
      23014 "2023 01"  7 7 0 0                  0
      23014 "2023 01"  1 0 0 0                  0
      23014 "2023 01"  1 0 0 0                  0
      23015 "2023 01"  1 0 0 0                  0
      23015 "2023 01"  3 0 0 0                  0
      23015 "2023 01"  1 0 0 0                  0
      23015 "2023 01"  1 0 0 0                  0
      23015 "2023 01"  1 0 0 0                  0
      23015 "2023 01"  2 0 0 0                  0
      23015 "2023 01"  7 5 1 1 14.285714285714286
      23015 "2023 01"  5 5 0 1                 20
      23015 "2023 01"  5 5 0 0                  0
      23015 "2023 01"  5 5 0 0                  0
      23015 "2023 01"  4 3 0 0                  0
      23015 "2023 01"  5 5 0 0                  0
      23015 "2023 01"  5 4 0 0                  0
      23015 "2023 01"  3 3 0 0                  0
      23015 "2023 01"  3 3 0 0                  0
      23015 "2023 01"  5 4 0 0                  0
      23015 "2023 01"  2 2 0 0                  0
      23015 "2023 01"  6 6 0 0                  0
      23015 "2023 01"  3 3 0 0                  0
      23015 "2023 01"  3 3 0 0                  0
      23015 "2023 01"  6 4 1 1 16.666666666666668
      23015 "2023 01"  1 1 0 0                  0
      23015 "2023 01"  1 0 0 0                  0
      23016 "2023 01"  1 0 0 0                  0
      23016 "2023 01"  5 5 0 0                  0
      23016 "2023 01"  6 6 0 0                  0
      end
      format %td EventDate

      Comment


      • #4
        Here is my do file:



        gen Year_CYQ = qofd(EventDate)
        format Year_CYQ %tq
        collapse (sum) T_CallsOffered T_CallsAnswered, by(Year_CYQ)
        twoway (line T_CallsOffered Year_CYQ, sort lcolor(teal) lwidth(thick) cmissing(n)) ///
        (line T_CallsAnswered Year_CYQ, sort lcolor(dknavy) lwidth(thick) cmissing(n)), yscale(range(0 .)) yla(0(500) 6000) xscale(range(252 255))

        Comment


        • #5
          I get the attached graph.
          Attached Files

          Comment


          • #6
            Sorry I just realized I don't have the full dataset. I will repost it.
            Last edited by Artur Deguzman; 29 Jan 2024, 14:29.

            Comment


            • #7
              Unfortunately, I cannot get the full data set from Stata. I am very new to Stata and do not know all the commands yet. A search did not produce any meaningful results.

              The data comes from an SQL query. I will attach it as a CSV file. I hope that is OK.

              The CSV file does not have the variable names, I believe. Here they are:

              EventDate Year_MO T_CallsOffered T_CallsAnswered T_RouterCallsAbandQ T_TotalCallsAband Percent_Abandoned

              Thanks!
              Attached Files

              Comment


              • #8
                We appreciate that there's a lot to learn about Stata when you start and about Statalist when you first post.

                However, here you're asking us to download some data, supplying the variable names, then run some code, and then compare with a graph, which we also need to download. And then answer the question.

                Sorry, but I won't do all that, and no one else is volunteering.

                https://www.statalist.org/forums/help#stata includes everything you need to know. Post your CODE between delimiters, a data example using dataex and your graph as a .png attachment.
                Last edited by Nick Cox; 30 Jan 2024, 05:40.

                Comment

                Working...
                X