I am using Stata 14 and using the kdens package. Here is my code:
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
clearHere 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.
set seed 1200
set obs 1000
gen foo = rnormal()
kdens foo, ci bw(2) level(95) kernel(epanechnikov)
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