scattersmooth {gamlss.util} | R Documentation |
The function produced two dimensional smooth scatter plots. The method used is described in Eilers and Goeman (2004).
scattersmooth(x, y, nbin = 100, lambda = 1, ndot = 500, csize = 0.3, ticks = TRUE, xlim = c(min(x), max(x)), ylim = c(min(y), max(y)), show = TRUE, save = FALSE, data = NULL)
x |
the x-variable |
y |
the y-variable |
nbin |
the number of bins required |
lambda |
the smoothing parameter |
ndot |
how many data points to show |
csize |
the size of the data points |
ticks |
whether ticks in the x and y axis appear in the plot |
xlim |
the x limit |
ylim |
the y limit |
show |
whether to show the graph or not |
save |
whether to save the output as a list or not |
data |
the data file data
|
The function is similar to the function smoothScatter()
in graphics but it used penelized bin smoother as
described in Eilers and Goeman (2004) rather than kernel smoother.
the function produces a two dimensional smooth plot and saves if save=TRUE
a list with the following components:
Hraw |
A nbin by nbin matrix containing the bin row data |
Hsmooth |
A nbib by nbib matrix containing the smooth two dimensional histogram |
xgrid |
the x-grid |
ygrid |
the y-grid |
xbin |
the bin for x values |
ybin |
the bin for y values |
nmiss |
number of missing values |
seldots |
the values of the plotted dots |
Paul Eilers p.eilers@erasmusmc.nl
Eilers, P. H. C. and Goeman, J. J. (2004). Enhancing scatterplots with smoothed density. Bioinformatics, Vol 20 no 5, pp 623-628.
Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion), Appl. Statist., 54, part 3, pp 507-554.
Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R. Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007, http://www.jstatsoft.org/v23/i07.
m <- 1000 set.seed(pi) phi <- 2 * pi * runif(m) rho <- rchisq(m, df = 6) x <- cos(phi) * rho y <- sin(phi) * rho H <- scattersmooth(x, y)