# Kernel density estimation to check whether distribution is lognormal

I am using the kdens package in Stata to estimate the kernel density of some economic data. I would like to check if my data could possibly come from a normal distribution. My question is about the selection of bandwidth in kernel density estimation. I know that if I choose a bandwidth sufficiently below the optimal bandwidth, I get zero bias asymptotically. So then I could simply construct my confidence intervals for the density estimate and see if the normal density lies within the interval. The figure below shows the results for this.

However, if I choose a larger bandwidth (oversmoothing), then I get the following result.

My final conclusion (normality) would be different for two different bandwidths. I would appreciate it if someone could explain me how to proceed from here on.

• Kernel density estimation is not how I would assess normality. Use a normal probability plot (qnorm in Stata). Your plots hint at strong granularity in the data (spikes at certain values) which makes any claim to normality both less plausible and more difficult to test. – Nick Cox Nov 30 '15 at 0:39
• As your variable appears to be in logarithm form already, you are checking for a lognormal distribution. – Nick Cox Nov 30 '15 at 0:40
• @NickCox Thanks for your comment. Unfortunately I have to use the kernel density estimation method to assess normality. You are right about the lognormal part. – Calculon Nov 30 '15 at 6:32
• I don't understand the "have to". If this is homework or more generally self-study it should be flagged and tagged as such. Note that your kernel shape (Epanechnikov default) is all too visible in the graphs, emblematic of spikes in the data. – Nick Cox Nov 30 '15 at 7:13
• @NickCox Sorry I forgot to mention that this is part of a homework. I will add the appropriate tag. – Calculon Nov 30 '15 at 7:17