ofc0 = rnorm(1000,34.5,1.5)
ofc = round(ofc0)
x0 = seq(28,42, length=100)
f0 = dnorm(x0, 34.5, 1.5)
plot(x0, f0, type='l', col=2)
out0 = lprde(ofc0, bandwidth=.25)
lines(out0, col=4, lty=2)
out1 = lprde(ofc, binned=TRUE,bandwidth=1)
lines(out1, col=1, lty=2)
bdat = binning(ofc0)
out3 = lpreg(bdat$x, bdat$y, binned=TRUE, bandwidth=.3)
lines(out3, col=4, lwd=3)
Run the code above in your browser using DataLab