# plot.scan.test

##### Plot Result of Scan Test

Computes or plots an image showing the likelihood ratio test statistic for the scan test, or the optimal circle radius.

##### Usage

```
# S3 method for scan.test
plot(x, …, what=c("statistic", "radius"),
do.window = TRUE)
``` # S3 method for scan.test
as.im(X, …, what=c("statistic", "radius"))

##### Arguments

- x,X
Result of a scan test. An object of class

`"scan.test"`

produced by`scan.test`

.- …
Arguments passed to

`plot.im`

to control the appearance of the plot.- what
Character string indicating whether to produce an image of the (profile) likelihood ratio test statistic (

`what="statistic"`

, the default) or an image of the optimal value of circle radius (`what="radius"`

).- do.window
Logical value indicating whether to plot the original window of the data as well.

##### Details

These functions extract, and plot, the spatially-varying value of the likelihood ratio test statistic which forms the basis of the scan test.

If the test result `X`

was based on circles of
the same radius `r`

, then `as.im(X)`

is a pixel image
of the likelihood ratio test statistic as a function of the
position of the centre of the circle.

If the test result `X`

was based on circles of
several different radii `r`

, then `as.im(X)`

is a pixel image
of the profile (maximum value over all radii `r`

)
likelihood ratio test statistic as a function of the
position of the centre of the circle, and
`as.im(X, what="radius")`

is a pixel image giving
for each location \(u\) the value of `r`

which maximised
the likelihood ratio test statistic at that location.

The `plot`

method plots the corresponding image.

##### Value

The value of `as.im.scan.test`

is a pixel image (object of
class `"im"`

). The value of `plot.scan.test`

is `NULL`

.

##### See Also

##### Examples

```
# NOT RUN {
if(interactive()) {
a <- scan.test(redwood, seq(0.04, 0.1, by=0.01),
method="poisson", nsim=19)
} else {
a <- scan.test(redwood, c(0.05, 0.1), method="poisson", nsim=2)
}
plot(a)
as.im(a)
plot(a, what="radius")
# }
```

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