slrm(formula, ..., data = NULL, offset = TRUE, link = "logit",
dataAtPoints=NULL, splitby=NULL)
pixellate
determining the pixel resolution for the discretisation
of the point pattern.formula
, with one row for each
point in the point pattern dataset."slrm"
representing the fitted model. There are many methods for this class, including methods for
print
, fitted
, predict
,
anova
, coef
, logLik
, terms
,
update
, formula
and vcov
.
Automated stepwise model selection is possible using
step
.
The formula
specifies the form of the model to be fitted,
and the data to which it should be fitted. The formula
must be an Rformula with a left and right hand
side.
The left hand side of the formula
is the name of the
point pattern dataset, an object of class "ppp"
.
The right hand side of the formula
is an expression,
in the usual Rformula syntax, representing the functional form of
the linear predictor for the model.
Each variable name that appears in the formula may be
x
andy
,
referring to the Cartesian coordinates;data
, if this argument is given;slrm
was issued."im"
)
containing the values of a covariate;"owin"
), which will be
interpreted as a logical covariate which isTRUE
inside the
window andFALSE
outside it;function
in theRlanguage, with argumentsx,y
, which can be evaluated at any location to
obtain the values of a covariate.The fitting algorithm discretises the point pattern onto a pixel grid. The value in each pixel is 1 if there are any points of the point pattern in the pixel, and 0 if there are no points in the pixel. The dimensions of the pixel grid will be determined as follows:
...
if they are specified (for example the argumentdimyx
can be used to specify the number of pixels).formula
includes
the names of any pixel images containing covariate values,
these images will determine the pixel grid for the discretisation.
The covariate image with the finest grid (the smallest pixels) will
be used.spatstat.options("npixel")
.link="logit"
(the default), the algorithm fits a Spatial Logistic
Regression model. This model states that the probability
$p$ that a given pixel contains a data point, is related to the
covariates through
$$\log\frac{p}{1-p} = \eta$$
where $\eta$ is the linear predictor of the model
(a linear combination of the covariates,
whose form is specified by the formula
). If link="cloglog"
then the algorithm fits a model stating that
$$\log(-\log(1-p)) = \eta$$.
If offset=TRUE
(the default), the linear predictor includes
an offset term equal to the logarithm of the pixel area. This ensures
that the fitted parameters are approximately independent of pixel
size. If offset=FALSE
, the offset is not included, and the
traditional form of Spatial Logistic Regression is fitted.
Baddeley, A., Berman, M., Fisher, N.I., Hardegen, A., Milne, R.K., Schuhmacher, D., Shah, R. and Turner, R. (2010) Spatial logistic regression and change-of-support for spatial Poisson point processes. Electronic Journal of Statistics 4, 1151--1201. {doi: 10.1214/10-EJS581}
Tukey, J.W. (1972) Discussion of paper by F.P. Agterberg and S.C. Robinson. Bulletin of the International Statistical Institute 44 (1) p. 596. Proceedings, 38th Congress, International Statistical Institute.
anova.slrm
,
coef.slrm
,
fitted.slrm
,
logLik.slrm
,
plot.slrm
,
predict.slrm
data(copper)
X <- copper$SouthPoints
slrm(X ~ 1)
slrm(X ~ x+y)
slrm(X ~ x+y, link="cloglog")
# specify a grid of 1 km square pixels
slrm(X ~ 1, eps=1)
Y <- copper$SouthLines
Z <- distmap(Y)
slrm(X ~ Z)
slrm(X ~ Z, dataAtPoints=list(Z=nncross(X,Y)$dist))
dat <- list(A=X, V=Z)
slrm(A ~ V, data=dat)
Run the code above in your browser using DataLab