spml: Spatial Panel Model by Maximum Likelihood

View source: R/spml.R

spmlR Documentation

Spatial Panel Model by Maximum Likelihood

Description

Maximum likelihood (ML) estimation of spatial panel models, possibly with fixed or random effects.

Usage

spml(formula, data, index=NULL, listw, listw2=listw, na.action,
                 model=c("within","random","pooling"),
                 effect=c("individual","time","twoways"),
                 lag=FALSE, spatial.error=c("b","kkp","none"),
                 ...)

Arguments

formula

a symbolic description of the model to be estimated

data

an object of class data.frame or pdata.frame. A data frame containing the variables in the model. When the object is a data.frame, the first two columns shall contain the indexes, unless otherwise specified. See index

index

if not NULL (default), a character vector to identify the indexes among the columns of the data.frame

listw

an object of class listw or a matrix. It represents the spatial weights to be used in estimation.

listw2

an object of class listw or a matrix. Second of set spatial weights for estimation, if different from the first (e.g., in a 'sarar' model).

na.action

see spdep for more details.

model

one of c("within", "random", "pooling").

effect

one of c("individual","time","twoways"); the effects introduced in the model.

lag

default=FALSE. If TRUE, a spatial lag of the dependent variable is added.

spatial.error

one of c("b","kkp","none"). The type of spatial error in the specification, if any. See details.

...

additional argument to pass over to other functions

Details

The models are estimated by two-step Maximum Likelihood. Further optional parameters to be passed on to the estimator may be: pvar: if TRUE the pvar function is called hess: if TRUE use numerical Hessian instead of GLS for the standard errors of the estimates quiet: if FALSE report function and parameters values during optimization initval: one of c("zeros", "estimate"), the initial values for the parameters. If "zeros" a vector of zeros is used. if "estimate" the initial values are retreived from the estimation of the nested specifications. Alternatively, a numeric vector can be specified. x.tol: Tolerance. See nlminb for details. rel.tol: Relative tolerance. See nlminb for details.

Value

An object of class "splm".

coefficients

coefficients estimate of the model parameters

arcoef

the coefficient for the spatial lag on y

errcomp

the estimates of the error variance components

vcov

the asymptotic variance covariance matrix of the estimated coefficients

vcov.arcoef

the asymptotic variance of the estimated spatial lag parameter

vcov.errcomp

the asymptotic variance covariance matrix of the estimated error covariance parameters

type

'random effects ML'

residuals

the model residuals

fitted.values

the fitted values, calculated as \hat{y}=X \hat{\beta}

sigma2

GLS residuals variance

model

the matrix of the data used

call

the call used to create the object

logLik

the value of the log likelihood function at the optimum

errors

the value of the errors argument

Author(s)

Giovanni Millo

References

Baltagi, B.H., Song, S.H., Jung B. and Koh, W. (2007) Testing panel data regression models with spatial and serial error correlation. Journal of Econometrics, 140, 5-51.

Millo, G., Piras, G. (2012) splm: Spatial Panel Data Models in R. Journal of Statistical Software, 47(1), 1–38. URL http://www.jstatsoft.org/v47/i01/.

See Also

spgm

Examples

data(Produc, package = "plm")
data(usaww)
fm <- log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp
## the two standard specifications (SEM and SAR) one with FE
## and the other with RE:
## fixed effects panel with spatial errors
fespaterr <- spml(fm, data = Produc, listw = spdep::mat2listw(usaww),
                   model="within", spatial.error="b", Hess = FALSE)
summary(fespaterr)
## random effects panel with spatial lag
respatlag <- spml(fm, data = Produc, listw = spdep::mat2listw(usaww),
                   model="random", spatial.error="none", lag=TRUE)
summary(respatlag)
## calculate impact measures
#impac1 <- impacts.splm(respatlag, listw = spdep::mat2listw(usaww, #style = "W"), time = 17)
#summary(impac1, zstats=TRUE, short=TRUE)

splm documentation built on July 26, 2023, 5:44 p.m.

Related to spml in splm...