The lpoly command works fine as long as my dataset is not too large. Using a dataset with about 45,000,000 observations, I get gaps in the graph. I stored the smoothing grid and the smoothed points and saw that there seems to be a problem saving these two variables.

stata version: 15
command: lpoly varA varB if varB >= -.4 & varB <= .4 [aweight=varC], noscatter ci bwidth(0.05) generate(gvarB gvarA)

For 45 smoothing grids the corresponding smoothed point is saved. But for 5 smoothing grids the smoothed point is missing. At the same time stata saved 5 smoothed points without a corresponding smoothing grid. Increasing the number of observations in the dataset results in more grids. (My dataset has 90,000,000 observations, using a 5 % or 10 % sample works fine. First gaps in the graph appear using a 20 % sample.)

Is there an alternative command or a solution to the problem? Thank you in advance, Heiko