It produces two level plots, side-by-side, where the x- and y-axis are
the predictors (
y) of the given
Mort2Dsmooth object and the numeric response is either the
matrices of actual and fitted log-rates, or the matrices of actual and
1 2 3 4 5 6 7 8
an object of class "Mort2Dsmooth", usually, a result of
a call to
the type of plot which should be returned. The
a string with the color palette for creating a vector
of contiguous colors. Default:
other plotting parameters passed to
The function provides a simple tool for checking the outcomes of a
Mort2Dsmooth object. In a Poisson setting, one would commonly
look at rates in log-scale, but actual and fitted counts can be
The function uses
levelplot from package
construct the two level plots side-by-side. Plotting
parameters are given and cannot be changed. The only expection is the
color palette: five different palletes are available and described in
the associated documentation: the default
A palette with 9 colors is chosen and the breaks for the level plot are chosen according to the deciles of distributions of actual and fitted log-rates (counts).
None. Function produces a plot.
Carlo G Camarda
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
## selected data ages <- 50:100 years <- 1970:2006 death <- selectHMDdata("Denmark", "Deaths", "Females", ages = ages, years = years) exposure <- selectHMDdata("Denmark", "Exposures", "Females", ages = ages, years = years) ## fit fit <- Mort2Dsmooth(x=ages, y=years, Z=death, offset=log(exposure), method=3, lambdas=c(100,500)) ## plotting log-death rates plot(fit, palette="terrain.colors") ## plotting death counts plot(fit, type="death")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.