Announcement

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

  • Control number of bins in binscatter

    I generate a binscatter using
    Code:
    sysuse auto, clear
    binscatter price mpg, nq(100) rd(30) line(none)
    The issue is that the dataset includes many more observations with mpg < 30 than with mpg > 30. Is it possible to increase the number of bins (reduce the bandwidth) for x>30 to make the plot look more balanced?
    Last edited by David Tsu; 02 Jun 2021, 15:54.

  • #2
    binscatter is from SSC, as you are asked to explain (FAQ Advice #12).

    You can bin using an existing variable, so create that beforehand.

    Comment


    • #3
      Originally posted by Nick Cox View Post
      binscatter is from SSC, as you are asked to explain (FAQ Advice #12).

      You can bin using an existing variable, so create that beforehand.
      Thanks! I updated the question with a reproducible example.

      Comment

      Working...
      X