Announcement

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

  • kdens confidence intervals are kinked, do not overlap density estimates

    I am using Stata 14 and using the kdens package. Here is my code:
    clear
    set seed 1200
    set obs 1000
    gen foo = rnormal()
    kdens foo, ci bw(2) level(95) kernel(epanechnikov)
    Here I am attempting to estimate and graph a normal distribution using kernel density, including the 95% confidence interval. The graphic that apperas shows the confidence interval only covers the density estimate on the edges. However, in the middle the confidence intervals exhibit a sharp kink and become horizontal such that they do not cover the density estimate.

    This does not happen when specifying a sufficiently small bandwidth (e.g., bw(0.2)) nor when specifying bw(silverman).

    Does anyone know why this happens?

    Thank you,
    Eric

Working...
X