# model.matrix.slrm

From spatstat v1.29-0
by Adrian Baddeley

##### Extract Design Matrix from Spatial Logistic Regression Model

This function extracts the design matrix of a spatial logistic regression model.

##### Usage

```
## S3 method for class 'slrm':
model.matrix(object, ..., keepNA=TRUE)
```

##### Arguments

- object
- A fitted spatial logistic regression model. An object of class
`"slrm"`

. - ...
- Other arguments (such as
`na.action`

) passed to`model.matrix.lm`

. - keepNA
- Logical. Determines whether rows containing NA values will be deleted or retained.

##### Details

This command is a method for the generic function
`model.matrix`

. It extracts the design matrix of a
spatial logistic regression.
The `object`

must be a fitted
spatial logistic regression
(object of class `"slrm"`

).
Such objects are produced by the model-fitting
function `slrm`

.

Usually the result is a matrix with one column for every constructed covariate in the model, and one row for every pixel in the grid used to fit the model.

If `object`

was fitted using split pixels (by calling
`slrm`

using the argument `splitby`

) then the
matrix has one row for every pixel or half-pixel.

##### Value

- A matrix. Columns of the matrix are canonical covariates in the model.

##### See Also

##### Examples

```
fit <- slrm(japanesepines ~x)
head(model.matrix(fit))
# matrix with two columns: '(Intercept)' and 'x'
```

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

### Community examples

Looks like there are no examples yet.