File: locpoly.R

package info (click to toggle)
kernsmooth 2.23-26-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 248 kB
  • sloc: fortran: 508; ansic: 51; makefile: 2
file content (11 lines) | stat: -rw-r--r-- 437 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
## from Peter Dalgaard 2020-11-24
## '(without the truncate=FALSE, curves pretty much go through
##   the penultimate point, whatever reasonable bandwith is chosen.)'

library(KernSmooth)
if(require("carData")) {
plot(prestige ~ income, data = Prestige)
with(Prestige, lines(locpoly(income, prestige, bandwidth = 5000)))
with(Prestige, lines(locpoly(income, prestige,
                             bandwidth = 5000, truncate = FALSE)))
}