Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Kernel density estimation in a large dataset


From   "Eva Poen" <[email protected]>
To   <[email protected]>
Subject   st: Kernel density estimation in a large dataset
Date   Tue, 16 Nov 2004 16:55:02 +0100

Dear all,

I want to do Kernel density estimation and local polynomial regression
on a dataset with 20'000 observations using Stata 8.2. Computations
using all
observations as a grid, like in

- kdensity x, at(x) gen(xdens) -

take quite a long time (between 10 and 15 minutes each). So I would like
to use a grid of, say, 1000 points, but still have density estimates for
all my observations. That is, I want to have a variable xdens which
contains in observation i

- the exact estimated density if x[i] happens to be a grid point
- the linear interpolation of the two densities estimated at the the
closest grid points to the left and right of x[i]

for all 20'000 observations. I was told that this is the default
behaviour in EViews, but I have really no clue how to best implement
this in Stata.

Thanks a lot for any suggestions.
Best regards,

Eva Poen

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index