| Title: | Partial Maximum Likelihood Estimation of Spatial Probit Models |
| Version: | 1.0.1 |
| Description: | Estimate spatial autoregressive nonlinear probit models with and without autoregressive disturbances using partial maximum likelihood estimation. Estimation and inference regarding marginal effects is also possible. For more details see Bille and Leorato (2020) <doi:10.1080/07474938.2019.1682314>. |
| License: | GPL (≥ 3) |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.2 |
| Suggests: | testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| Imports: | abind, Matrix, matrixcalc, maxLik, methods, minqa, mvtnorm, numDeriv, qrng, spatialreg, spdep, stats, utils |
| Depends: | R (≥ 3.5) |
| LazyData: | true |
| URL: | https://github.com/d-spinelli/pmlsp |
| BugReports: | https://github.com/d-spinelli/pmlsp/issues |
| NeedsCompilation: | no |
| Packaged: | 2026-01-27 14:20:09 UTC; Ospite |
| Author: | Daniele Spinelli [aut, cre], Anna Gloria Bille' [aut], Samantha Leorato [aut] |
| Maintainer: | Daniele Spinelli <daniele.spinelli@unimib.it> |
| Repository: | CRAN |
| Date/Publication: | 2026-01-31 19:00:02 UTC |
pmlsp: Partial Maximum Likelihood Estimation of Spatial Probit Models
Description
Estimate spatial autoregressive nonlinear probit models with and without autoregressive disturbances using partial maximum likelihood estimation. Estimation and inference regarding marginal effects is also possible. For more details see Bille and Leorato (2020) doi:10.1080/07474938.2019.1682314.
Author(s)
Maintainer: Daniele Spinelli daniele.spinelli@unimib.it
Authors:
Anna Gloria Bille'
Samantha Leorato
See Also
Useful links:
Average Marginal Effects for Spatial Probit Models
Description
Computes average direct, indirect, and total marginal effects from an object
of class "pmlsprobit" using numerical derivatives.
Usage
ape(mod, variables = NULL)
Arguments
mod |
An object of class |
variables |
Character vector specifying the names of covariates for which
marginal effects are computed. This option should be used only when the model
contains nonlinear terms in the specification |
Value
A named list with three elements corresponding to the average direct, indirect, and total marginal effects for each covariate.
See Also
Partial maximum likelihood estimation is implemented in
pmlsbp.
Examples
data(oldcol, package = "spdep")
dat <- COL.OLD
dat$y <- as.numeric(dat$CRIME > 35)
listw <- spdep::nb2listw(COL.nb, style = "W")
set.seed(857489)
mod <- pmlsbp(
y ~ HOVAL + INC, data = dat, W = listw,
model = "SAR", grouping = 7,
mvtnorm_control = list(
M = 25e2, sim_type = "mc",
tol = .Machine$double.eps, fast = FALSE
),
na.action = na.omit, spectral = TRUE,
iterlim = 1e5
)
ape(mod)
Coefficient Estimates for Partial Maximum Likelihood Spatial Probit Models
Description
Extracts the estimated regression coefficients from an object of class
"pmlsprobit".
Usage
## S3 method for class 'pmlsprobit'
coef(object, ...)
Arguments
object |
An object of class |
... |
Additional arguments (currently unused). |
Value
A named numeric vector containing the coefficient estimates.
See Also
Partial maximum likelihood estimation is implemented in
pmlsbp.
Eurostat employment data
Description
The eurostat data frame has 312 row and 10 variables. Unit of analysis: 312 regions in Europe. Additionally, the eurostat.nb includes the neighbour list based on a consider a k-nearest neighbour approach with k = 11
Usage
data(eurostat)
Format
A data frame with 312 rows and 10 variables:
nuts_idRegion identifier
country_idCountry identfier
employmentEmployement rate in percentage
gdpGDP per capita
isced_02percentage of residents aged 25-64 with secondary school achievement or lower
isced_34percentage of residents aged 25-64 with high school achievement or lower
isced_58percentage of residents aged 25-64 with bachelor degree or higher
longLongitude
latLatitude
Source
https://ec.europa.eu/eurostat/data/database
Fitting Spatial Probit Models by Partial Maximum Likelihood
Description
Fits spatial autoregressive probit models using partial maximum likelihood as proposed in Bille and Leorato (2020) doi:10.1080/07474938.2019.1682314. Both Spatial Autoregressive (SAR) probit models and Spatial Autoregressive Probit Models with Autoregressive Disturbances (SARAR) are supported.
Usage
pmlsbp(
formula, data, model = "SAR", grouping = 2,
W = NULL,
zero.policy = spatialreg::get.ZeroPolicyOption(),
M = NULL, formula_xlag = NULL, W2 = NULL,
method_inv = "solve",
start = NULL, subset = NULL, na.action = na.fail,
qu = Inf, iterlim = 1000,
mvtnorm_control = list(M = 1e4, sim_type = "qmc",
tol = .Machine$double.eps, fast = FALSE),
finalHessian = ifelse(method == "bhhh", method, TRUE),
method = "bhhh", print.level = 2,
vce.type = "asy",
Conley = list(coords = NULL, LM = 2),
nBoot = 1e3, spectral = FALSE,
verbose = TRUE ,
tol.solve = .Machine$double.eps,
version = 0, ...
)
## S3 method for class 'pmlsprobit'
print(x, digits = max(3, getOption("digits") - 3), ...)
Arguments
formula |
An object of class |
data |
An optional data frame containing the variables in the model. |
model |
A character string specifying the model type; either
|
grouping |
An integer defining the number of observations to include in the tuples used for estimation. |
W |
A spatial weights object of class |
zero.policy |
Logical; if |
M |
A spatial weights object of class |
formula_xlag |
An optional |
W2 |
A spatial weights object used to construct spatially lagged
covariates; relevant only if |
method_inv |
Character string specifying the method used to invert
|
start |
Numeric vector of starting values. |
subset |
Optional vector specifying a subset of observations. |
na.action |
A function specifying how missing values are handled. |
qu |
Integer used only if |
iterlim |
Integer specifying the maximum number of iterations. |
mvtnorm_control |
A list of control parameters for multivariate normal
probability calculations; see |
finalHessian |
Logical or character specifying how the final Hessian
matrix is computed; see |
method |
Maximization method passed to |
print.level |
Integer controlling the amount of diagnostic output. |
vce.type |
Character specifying the variance–covariance estimator;
one of |
Conley |
A list specifying options for the modified Conley estimator. |
nBoot |
Integer specifying the number of bootstrap replications. |
spectral |
Logical; if |
verbose |
Logical; if |
tol.solve |
Numeric tolerance used when inverting matrices. |
version |
Integer controlling the computation of bivariate normal
integrals when |
... |
Additional arguments passed to |
x |
a |
digits |
integer, used for number formatting the decimal digits |
Details
The SARAR model is defined as
y^* = \rho W y + X \beta + W_2 Z \gamma + u
with
u = \lambda M u + \epsilon,
where \epsilon \sim N(0,\sigma^2) and the observed binary outcome is
y = 1(y^* > 0). The SAR model is obtained by setting \lambda = 0.
Value
An object of class "pmlsprobit", which is a list containing:
betaNamed vector of regression coefficients.
callThe matched function call.
codeConvergence code from
maxLik.estimateNamed vector of parameter estimates.
fList of matrices used for prediction.
maximumValue of the partial log-likelihood.
messageConvergence message from
maxLik.modelModel frame used in estimation.
model.typeEither
"SAR"or"SARAR".rhoEstimated spatial autoregressive parameter.
slxLogical indicating the presence of spatially lagged covariates.
startStarting values used in estimation.
termsTerms object.
vcovVariance–covariance matrix of the estimates.
WSpatial weights matrix
W.lambdaEstimated disturbance parameter (SARAR only).
MSpatial weights matrix
M(SARAR only).W2Spatial weights matrix
W_2(ifslx = TRUE).
No return value
Functions
-
print(pmlsprobit): prints the call and the coefficient estimates of a"pmlsprobit"object
References
Bille', A. G., & Leorato, S. (2020). Partial ML estimation for spatial autoregressive nonlinear probit models with autoregressive disturbances. Econometric Reviews, 39(5), 437–475. doi:10.1080/07474938.2019.1682314
See Also
Examples
data(oldcol, package = "spdep")
dat <- COL.OLD
dat$y <- as.numeric(dat$CRIME > 35)
listw <- spdep::nb2listw(COL.nb, style = "W")
set.seed(857489)
mod <- pmlsbp(
y ~ HOVAL + INC, data = dat, W = listw,
model = "SAR", grouping = 7,
na.action = na.omit, spectral = TRUE,
iterlim = 1e5
)
Predicted Values and Marginal Effects for Spatial Probit Models
Description
Computes predicted probabilities or average marginal effects from an object
of class "pmlsprobit".
Usage
## S3 method for class 'pmlsprobit'
predict(
object,
type = "prob",
newdata = NULL,
variables = NULL,
delta.method = FALSE,
...
)
Arguments
object |
An object of class |
type |
Character string specifying the type of prediction.
Use |
newdata |
Optional data frame containing variables used for prediction. If omitted, the fitted values are used. |
variables |
Character vector of covariate names for which marginal
effects are computed using numerical derivatives. Only used if
|
delta.method |
Logical; if |
... |
Additional arguments (currently unused). |
Value
If type = "prob", a numeric vector of predicted probabilities.
If type = "me", a list of matrices containing individual direct,
indirect, and total marginal effects for each covariate.
See Also
Partial maximum likelihood estimation is implemented in
pmlsbp.
Examples
data(oldcol, package = "spdep")
dat <- COL.OLD
dat$y <- as.numeric(dat$CRIME > 35)
listw <- spdep::nb2listw(COL.nb, style = "W")
set.seed(857489)
mod <- pmlsbp(
y ~ HOVAL + INC, data = dat, W = listw,
model = "SAR", grouping = 7,
mvtnorm_control = list(
M = 25e2, sim_type = "mc",
tol = .Machine$double.eps, fast = FALSE
),
na.action = na.omit, spectral = TRUE,
iterlim = 1e5
)
prob <- predict(mod)
head(prob)
Print method for summary.pmlsprobit objects
Description
S3 method to print objects of class summary.pmlsprobit.
Usage
## S3 method for class 'summary.pmlsprobit'
print(x, digits = max(3L, getOption("digits") - 3L), ...)
Arguments
x |
An object of class |
digits |
Number of significant digits to print for coefficients. |
... |
Additional arguments (currently ignored). |
Value
No return value
Summarizing Partial Maximum Likelihood Spatial Probit Models
Description
Provides a summary method for objects of class "pmlsprobit".
Usage
## S3 method for class 'pmlsprobit'
summary(object, ...)
Arguments
object |
An object of class |
... |
Additional arguments (currently unused). |
Value
An object of class "summary.pmlsprobit" containing:
estimateMatrix of estimates, standard errors, z-values, and p-values.
rhoEstimated spatial autoregressive parameter.
lambdaEstimated spatial error parameter.
model.typeType of spatial probit model fitted.
loglikLog-likelihood at the optimum.
iterationNumber of iterations performed.
returnCodeOptimizer convergence code.
returnMessageMessage associated with the convergence code.
vcovVariance–covariance matrix of the parameter estimates.
See Also
Partial maximum likelihood estimation is implemented in
pmlsbp.
Examples
data(oldcol, package = "spdep")
dat <- COL.OLD
dat$y <- as.numeric(dat$CRIME > 35)
listw <- spdep::nb2listw(COL.nb, style = "W")
set.seed(857489)
mod <- pmlsbp(
y ~ HOVAL + INC, data = dat, W = listw,
model = "SAR", grouping = 7,
na.action = na.omit, spectral = TRUE,
iterlim = 1e5
)
summary(mod)
Variance–Covariance Matrix for Partial Maximum Likelihood Spatial Probit Models
Description
Extracts the variance–covariance matrix from an object of class
"pmlsprobit".
Usage
## S3 method for class 'pmlsprobit'
vcov(object, ...)
Arguments
object |
An object of class |
... |
Additional arguments (currently unused). |
Value
A numeric matrix containing the variance–covariance matrix of the parameter estimates.
See Also
Partial maximum likelihood estimation is implemented in
pmlsbp.