# plot.leverage.ppm

##### Plot Leverage Function

Generate a pixel image plot, or a contour plot, or a perspective plot,
of a leverage function that has been computed by `leverage.ppm`

.

##### Usage

```
# S3 method for leverage.ppm
plot(x, …,
what=c("smooth", "nearest", "exact"),
showcut=TRUE,
args.cut=list(drawlabels=FALSE),
multiplot=TRUE)
``` # S3 method for leverage.ppm
contour(x, …,
what=c("smooth", "nearest"),
showcut=TRUE,
args.cut=list(col=3, lwd=3, drawlabels=FALSE),
multiplot=TRUE)

# S3 method for leverage.ppm
persp(x, …,
what=c("smooth", "nearest"),
main, zlab="leverage")

##### Arguments

- x
Leverage function (object of class

`"leverage.ppm"`

) computed by`leverage.ppm`

.- …
Arguments passed to

`plot.im`

or`contour.im`

or`persp.im`

controlling the plot.- what
Character string (partially matched) specifying the values to be plotted. See Details.

- showcut
Logical. If

`TRUE`

, a contour line is plotted at the level equal to the theoretical mean of the leverage.- args.cut
Optional list of arguments passed to

`contour.default`

to control the plotting of the contour line for the mean leverage.- multiplot
Logical value indicating whether it is permissible to display several plot panels.

- main
Optional main title. A character string or character vector.

- zlab
Label for the \(z\) axis. A character string.

##### Details

These functions are the `plot`

, `contour`

and `persp`

methods
for objects of class `"leverage.ppm"`

.
Such objects are computed by the command `leverage.ppm`

.

The `plot`

method displays the leverage function
as a colour pixel image using `plot.im`

,
and draws a single contour line at the mean leverage value
using `contour.default`

.
Use the argument `clipwin`

to restrict the plot to a subset
of the full data.

The `contour`

method displays the leverage function as a contour
plot, and also draws a single contour line at the mean leverage value,
using `contour.im`

.

The `persp`

method displays the leverage function as a surface
in perspective view, using `persp.im`

.

Since the exact values of leverage are computed only at a finite set of quadrature locations, there are several options for these plots:

`what="smooth"`

:(the default) an image plot showing a smooth function, obtained by applying kernel smoothing to the exact leverage values;

`what="nearest"`

:an image plot showing a piecewise-constant function, obtained by taking the exact leverage value at the nearest quadrature point;

`what="exact"`

:a symbol plot showing the exact values of leverage as circles, centred at the quadrature points, with diameters proportional to leverage.

The pixel images are already contained in the object `x`

and were computed by `leverage.ppm`

;
the resolution of these images is controlled
by arguments to `leverage.ppm`

.

##### Value

Same as for `plot.im`

, `contour.im`

and `persp.im`

respectively.

##### References

Baddeley, A., Chang, Y.M. and Song, Y. (2013)
Leverage and influence diagnostics for spatial point process models.
*Scandinavian Journal of Statistics* **40**, 86--104.

##### See Also

##### Examples

```
# NOT RUN {
X <- rpoispp(function(x,y) { exp(3+3*x) })
fit <- ppm(X ~x+y)
lef <- leverage(fit)
plot(lef)
contour(lef)
persp(lef)
# }
```

*Documentation reproduced from package spatstat, version 1.63-0, License: GPL (>= 2)*