Announcement

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

  • why is my y-axis 0.0 on density

    Hello,

    I plotted my graph using the code:

    Question: Why am I get 0.0 on each demarcation of the y axis scale pls?
    How can i fix this?

    Code:
    twoway kdesnity postop if treatment ==1 [aw=attweight], bwidth(10) lcolor(red) ///
    || kdesnity postop if treatment ==0 [aw=attweight], bwidth(10) lcolor(blue) ///
    legend(order(1 "treatment" 0 "control") ring(0) cols(1) pos(1) ///
    ylabel(,angle(h) format(%3.1f)) ytitle("Density")
    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	26.6 KB
ID:	1743218

  • #2
    Difficult to say, But what is twoway kdesnity? Presumably twoway kdensity.

    You could try fixing it with an extra option such as yla(, format(%3.2f))

    Comment


    • #3
      that's correct -twoway kdensity - good spot !

      WIth regards to the suggestion you made in -post2- , I still get the same numbers on the y axis this time 0.03 on the density y axis with (,format(%3.2f))


      Is there another way I could increase the decimal points?

      Comment


      • #4
        If they're all 0.03 that makes no sense to me. Your Stata may be corrupted. Have you contacted StataCorp technical support?

        Comment


        • #5
          Alternatively, please post a reproducible data example that leads to the malformed graph in question with your Stata.

          Comment


          • #6
            Hi , no it’s not corrupted, i think there may be an issue with my Y scale in terms of not showing all decimal places after. i can not send a copy of the data via datex because i have 168,000 observations.

            Would a screenshot of a sample of the data work ?

            Comment


            • #7
              The idea behind dataex is to show a data example, not the entirety of a dataset unless it is very small.

              Please read the help for dataex and also FAQ Advice #12, which explains that screenshots are rarely as helpful as you hope.

              if you can’t give us a reproducible example then you should contact StataCorp as already suggested.

              Comment

              Working...
              X