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
. Confidence intervals for the parameters can be
computed using confint
.
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 R formula 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 R formula syntax, representing the functional form of
the linear predictor for the model.
Each variable name that appears in the formula may be
x
and y
,
referring to the Cartesian coordinates;
data
, if this argument is given;
slrm
was issued.
Each object appearing on the right hand side of the formula may be
"im"
)
containing the values of a covariate;
"owin"
), which will be
interpreted as a logical covariate which is TRUE
inside the
window and FALSE
outside it;
function
in the R language, with arguments
x,y
, which can be evaluated at any location to
obtain the values of a covariate.
See the Examples below.
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 argument
dimyx
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")
.
If 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 model formula will be
augmented by adding 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
,
vcov.slrm
X <- copper$SouthPoints
slrm(X ~ 1)
slrm(X ~ x+y)
slrm(X ~ x+y, link="cloglog")
# specify a grid of 2-km-square pixels
slrm(X ~ 1, eps=2)
Y <- copper$SouthLines
Z <- distmap(Y)
slrm(X ~ Z)
slrm(X ~ Z, dataAtPoints=list(Z=nncross(X,Y,what="dist")))
dat <- list(A=X, V=Z)
slrm(A ~ V, data=dat)
Run the code above in your browser using DataLab