Description Usage Arguments Details Value Author(s) See Also Examples
It produces two level plots, side-by-side, where the x- and y-axis are
the predictors (x
and 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
fitted counts.
1 2 3 4 5 6 7 8 |
x |
an object of class "Mort2Dsmooth", usually, a result of
a call to |
type |
the type of plot which should be returned. The
alternatives are: |
palette |
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
plotted too.
The function uses levelplot
from package lattice
to
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 rainbow
as
well as heat.colors
, terrain.colors
, topo.colors
,
and cm.colors
.
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
Mort2Dsmooth
for computing
Mort2Dsmooth.object
.
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")
|
Loading required package: svcm
Loading required package: Matrix
Loading required package: splines
Loading required package: lattice
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.