Announcement

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

  • -joy_plot- command: How to obtain a smooth curve?

    Hi everyone,

    Very quick question:

    I have produced the code below.

    Code:
    joy_plot kW_power_p1 if tariff_2 == 1 & tariff_2_more_15000_w == 0, scheme(white_w3d) over(product_classification_encod) lcolor(%100) fcolor(%20) alegend range(0 15)  ///
        title("{bf}Density Plot", pos(11) size(3)) ///
        subtitle("Contract Types, 1{sup:st} Period (Households)", pos(11) size(2.75)) ///
            ytitle("Density", size(2.5) orient(horizontal)) ///
            ylabel(, nogrid labsize(2)) ///
            xtitle("Contracted Powers (in kW)", size(2.5)) ///
            xlabel(0(1)15, labsize(2) nogrid format(%9.0fc))
    However, my densities are not smooth. How can I obtain smoother curves (i.e. normal ones) please?

    Here is my plot:
    Click image for larger version

Name:	Joy_plot.png
Views:	1
Size:	92.3 KB
ID:	1728784


    Thank you in advance.

    Michael

  • #2
    you can try the options bwadj2(#) or bwadj3()
    The first one is to "multiply" all BW by a number, making them smoother.
    bwadj3() sets the same bandwidth to all cases. (similar to using bw in kdensity)

    Comment


    • #3
      Hi again FernandoRios ,

      Thank you very much for your help.
      I tried -bwadj2(#)- option and this matches what I needed. Thank you so much.

      Best,

      Michael
      Last edited by Michael Duarte Goncalves; 02 Oct 2023, 08:10.

      Comment

      Working...
      X