[Splm-commits] r54 - in pkg: . man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Oct 21 21:57:57 CEST 2009


Author: gpiras
Date: 2009-10-21 21:57:57 +0200 (Wed, 21 Oct 2009)
New Revision: 54

Added:
   pkg/man/
   pkg/man/bsjktest.Rd
   pkg/man/bsktest.Rd
   pkg/man/effects.splm.Rd
   pkg/man/print.effects.splm.Rd
   pkg/man/print.splm.Rd
   pkg/man/spfeml.Rd
   pkg/man/splm-package.Rd
   pkg/man/spregm.Rd
   pkg/man/spreml.Rd
   pkg/man/spsegm.Rd
   pkg/man/summary.effects.splm.Rd.old
   pkg/man/summary.splm.Rd
   pkg/man/usaww.Rd
   pkg/man/write.effects.splm.Rd
Log:
upload new help files

Added: pkg/man/bsjktest.Rd
===================================================================
--- pkg/man/bsjktest.Rd	                        (rev 0)
+++ pkg/man/bsjktest.Rd	2009-10-21 19:57:57 UTC (rev 54)
@@ -0,0 +1,51 @@
+\name{bsjktest}
+\alias{bsjktest.formula}
+\alias{bsjktest}
+\title{Baltagi, Song, Jung and Koh LM test for spatial panels}
+\description{
+   Baltagi, Song, Jung and Koh marginal or conditional LM test for
+   spatial error correlation, serial error correlation or random effects in panel models
+}
+\usage{
+bsjktest(x,...)
+
+\method{bsjktest}{formula}(x, data, w, test=c(paste("C",1:3,sep="."),"J"), index=NULL, ...)
+
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+\item{x}{an object of class  \code{formula} or \code{splm}}
+  \item{data}{an object of class \code{\link{data.frame}} or \code{pdata.frame}. An optional data frame containing the variables
+  in the model. When the obect is a \code{\link{data.frame}}, the first two columns may contain the indexes. See \code{index}}
+  \item{index}{if not NULL (default), a character vector to identify the indexes among the columns of the \code{\link{data.frame}}}
+  \item{w}{An object of class \code{listw} or a \code{matrix}}
+  \item{test}{One of \code{c(paste("C",1:3,sep="."),"J")} the test to be performed}
+  \item{...}{additional arguments to be passed}
+}
+\details{
+If \code{test="J"} the joint test for spatial or serial error correlation or random individual 
+effects is returned; if \code{test} is one of \code{C.1}, \code{C.2} or \code{C.3} 
+the conditional test for, respectively, spatial errror correlation; serial error correlation; 
+random individual effects (with the other two effects possibly present) is returned.
+}
+\value{
+  An object of class \code{htest}
+}
+\references{
+Baltagi, B.H., Song, S.H., Jung B. and Koh, W. (2007)
+Testing panel data regression models with spatial and serial error correlation.
+\emph{Journal of Econometrics}, \bold{140}, 5-51.
+}
+\author{Giovanni Millo}
+\seealso{\code{\link{bsktest}}}
+
+\examples{
+data(Produc, package="Ecdat")
+Produc <- Produc[Produc$year<1975, ]
+data(usaww)
+fm <- log(gsp)~log(pcap)+log(pc)+log(emp)+unemp
+test1<-bsjktest(fm,data=Produc, w=usaww,
+  test="C.1")
+test1
+}
+\keyword{htest}


Property changes on: pkg/man/bsjktest.Rd
___________________________________________________________________
Name: svn:executable
   + 

Added: pkg/man/bsktest.Rd
===================================================================
--- pkg/man/bsktest.Rd	                        (rev 0)
+++ pkg/man/bsktest.Rd	2009-10-21 19:57:57 UTC (rev 54)
@@ -0,0 +1,51 @@
+\name{bsktest}
+\alias{bsktest}
+\alias{bsktest.formula}
+\alias{bsktest.lm}
+\alias{bsktest.splm}
+
+\title{Baltagi, Song and Koh LM test for spatial panels}
+\description{
+   Baltagi, Song and Koh marginal or conditional LM test for
+   spatial error correlation or random effects in panel models
+}
+\usage{
+bsktest(x,...)
+\method{bsktest}{formula}(x, data, w, test=c("SLM1","SLM2","LMJOINT","CLMlambda","CLMmu"), index=NULL, ...)
+\method{bsktest}{lm}(x, w, index=NULL, test=c("SLM1","SLM2","LMJOINT"), ...)
+\method{bsktest}{splm}(x, w, index=NULL, test=c("CLMlambda","CLMmu"), ...)
+}
+\arguments{
+\item{x}{an object of class  \code{formula} or \code{lm} or \code{splm} }
+  \item{data}{an object of class \code{\link{data.frame}} or \code{pdata.frame}. An optional data frame containing the variables
+  in the model. When the obect is a \code{\link{data.frame}}, the first two columns may contain the indexes. See \code{index}}
+  \item{index}{if not NULL (default), a character vector to identify the indexes among the columns of the \code{\link{data.frame}}}
+\item{w}{an object of class \code{listw} created for example by \code{nb2listw} }
+\item{test}{one of \code{c("SLM1","SLM2","LMJOINT","CLMlambda","CLMmu")}, the test to be performed}
+\item{...}{additional arguments to be passed}
+}
+
+\value{
+an object of class \code{htest}
+}
+\references{Baltagi, B.H., Song, S.H. and Koh, W. (2003)
+Testing panel data regression models with spatial error correlation.
+\emph{Journal of Econometrics}, \bold{117}, 123--150.}
+\author{Gianfranco Piras}
+\seealso{\code{\link{bsjktest}}}
+
+\examples{
+data(Produc, package="Ecdat")
+Produc <- Produc[Produc$year<1975, ]
+data(usaww)
+fm <- log(gsp)~log(pcap)+log(pc)+log(emp)+unemp
+test1<-bsktest(fm,data=Produc, w=mat2listw(usaww),
+  test="SLM1")
+class(test1)
+test1
+ml2 <- spfeml(fm, data = Produc, , mat2listw(usaww), model = "error", effects = "pooled")
+class(ml2)
+test5bis<-bsktest(ml2, w=mat2listw(usaww),index=Produc[,c(1,2)] ,test="CLMmu")
+summary(test5bis)
+}
+\keyword{htest}
\ No newline at end of file


Property changes on: pkg/man/bsktest.Rd
___________________________________________________________________
Name: svn:executable
   + 

Added: pkg/man/effects.splm.Rd
===================================================================
--- pkg/man/effects.splm.Rd	                        (rev 0)
+++ pkg/man/effects.splm.Rd	2009-10-21 19:57:57 UTC (rev 54)
@@ -0,0 +1,67 @@
+\name{effects.splm}
+\alias{effects.splm}
+\title{method for extracting fixed effects}
+
+\description{
+Methods used for extracting fixed effects from objects of class \code{splm} where \code{type} is one of 
+"fixed effects lag" or "fixed effects error"
+}
+
+\usage{
+\method{effects}{splm}(object,...)
+}
+
+\arguments{
+\item{object}{an object of class \code{'splm'}}
+\item{...}{additional arguments to be passed over}
+}
+
+\details{
+If the argument \code{object} is not of class \code{splm} 
+the function will terminate with an error.
+
+If the argument \code{object} is of class \code{splm} 
+but \code{type} is not one of 
+"fixed effects lag" or "fixed effects error",
+the function will terminate with an error.
+
+}
+
+
+\value{
+  An object of class \code{effects.splm}
+  \item{res}{a list whose elements are various type of fixed effects and the intercept (when present)}
+}
+
+\references{
+  Elhorst, J.P. (2003) 
+Specification and estimation of spatial panel data models,
+    \emph{International Regional Science Review}, \bold{26}, pages 244--268.
+
+  Elhorst, J.P. (2009) 
+Spatial panel data models,
+    \emph{In} Fischer, M.M. and Getis, A. (eds),
+    \emph{Handbook of Applied Spatial Analysis} Springer, Berlin.
+
+}
+
+\author{ Gianfranco Piras \email{gpiras at mac.com}}
+
+\seealso{
+\code{\link{spfeml}} \code{print.effects.splm} \code{summary.effects.splm}
+}
+\examples{
+data(Produc, package = "Ecdat")
+data(usaww)
+Produc <- Produc[Produc$year<1975, ]
+fm <- log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp
+lag <- spfeml(fm, data = Produc, listw = mat2listw(usaww), effects = "sptpfe", method = "eigen", quiet = TRUE) 
+summary(lag)
+eff <- effects(lag) 
+print(eff)
+err <- spfeml(fm, data = Produc, listw = mat2listw(usaww), model = "error", effects = "tpfe", method = "eigen", quiet = TRUE)
+summary(err)
+eff <- effects(err) 
+print(eff)
+}
+\keyword{spatial}
\ No newline at end of file


Property changes on: pkg/man/effects.splm.Rd
___________________________________________________________________
Name: svn:executable
   + 

Added: pkg/man/print.effects.splm.Rd
===================================================================
--- pkg/man/print.effects.splm.Rd	                        (rev 0)
+++ pkg/man/print.effects.splm.Rd	2009-10-21 19:57:57 UTC (rev 54)
@@ -0,0 +1,53 @@
+\name{print.effects.splm}
+\alias{print.effects.splm}
+\title{method for printing fixed effects from objects of class effects.splm}
+
+\description{
+Methods used for printing fixed effects from objects of class \code{effects.splm} generated using 
+\link{effects.splm}
+}
+
+\usage{
+\method{print}{effects.splm}(x,digits= max(3, getOption("digits") - 2), ...)
+}
+
+\arguments{
+\item{x}{an object of class \code{effects.splm}}
+\item{digits}{specifies the minimum number of significant digits to be printed in values. See \code{\link{print.default}} for details}
+\item{...}{additional arguments to be passed}
+}
+
+
+\references{
+  Elhorst, J.P. (2003) 
+Specification and estimation of spatial panel data models,
+    \emph{International Regional Science Review}, \bold{26}, pages 244--268.
+
+  Elhorst, J.P. (2009) 
+Spatial panel data models,
+    \emph{In} Fischer, M.M. and Getis, A. (eds),
+    \emph{Handbook of Applied Spatial Analysis} Springer, Berlin.
+
+}
+
+\author{ Gianfranco Piras \email{gpiras at mac.com}}
+
+\seealso{
+\code{\link{spfeml}} \code{print.effects.splm} \code{summary.effects.splm}
+}
+\examples{
+data(Produc, package = "Ecdat")
+data(usaww)
+Produc <- Produc[Produc$year<1975, ]
+fm <- log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp
+lag <- spfeml(fm, data = Produc, listw = mat2listw(usaww), effects = "sptpfe", method = "eigen", quiet = TRUE) 
+summary(lag)
+eff <- effects(lag) 
+print(eff)
+err <- spfeml(fm, data = Produc, listw = mat2listw(usaww), model = "error", effects = "tpfe", method = "eigen", quiet = TRUE)
+summary(err)
+eff <- effects(err) 
+print(eff)
+}
+
+\keyword{spatial}
\ No newline at end of file

Added: pkg/man/print.splm.Rd
===================================================================
--- pkg/man/print.splm.Rd	                        (rev 0)
+++ pkg/man/print.splm.Rd	2009-10-21 19:57:57 UTC (rev 54)
@@ -0,0 +1,47 @@
+\name{print.splm}
+\alias{print.splm}
+\title{print method for class splm}
+
+\description{
+Method to print objects of class \code{summary.splm} and \code{splm}
+}
+
+\usage{
+\method{print}{splm}(x, digits = max(3,getOption("digits") -3), ...)
+}
+
+\arguments{
+\item{x}{an object of class \code{splm}}
+\item{digits}{minimal number of significant digits, see \code{\link{print.default}}}
+\item{...}{additional arguments to be passed}
+}
+
+
+\details{
+The summary function \code{summary.splm} 
+returns an objects of class 'splm' 
+organized in a coefficient matrix.
+
+Also a matrix for the error components, 
+or the spatial coefficients will be generated 
+depending on the estimated model. 
+
+When the \code{'splm'} is produced by  
+the function 'spsegm', the summary 
+will be generated looping over the number
+of equations in the system.
+}
+
+\seealso{
+  \code{\link{spreml}}, \code{\link{spregm}}, \code{\link{spreml}}
+}
+\author{ Giovanni Millo \email{Giovanni\_Millo at Generali.com}, Gianfranco Piras\email{gpiras at mac.com}}
+
+\examples{
+data(Produc, package = "Ecdat") 
+data(usaww)
+Produc <- Produc[Produc$year<1975, ] 
+GM<-spregm(log(gsp)~log(pcap)+log(pc)+log(emp)+unemp, data=Produc,w=usaww,method="fulweigh")
+summary(GM)
+}
+\keyword{spatial}
\ No newline at end of file


Property changes on: pkg/man/print.splm.Rd
___________________________________________________________________
Name: svn:executable
   + 

Added: pkg/man/spfeml.Rd
===================================================================
--- pkg/man/spfeml.Rd	                        (rev 0)
+++ pkg/man/spfeml.Rd	2009-10-21 19:57:57 UTC (rev 54)
@@ -0,0 +1,132 @@
+\name{spfeml}
+\alias{spfeml}
+\title{Spatial Panel Fixed Effects Models Estimation}
+\description{Maximum likelihood (ML) estimation of spatial panel
+fixed effects models}
+
+\usage{
+spfeml(formula, data, index=NULL,listw, model=c("lag","error"),
+effects=c('pooled','spfe','tpfe','sptpfe'), method="eigen",
+na.action=na.fail,quiet=TRUE,zero.policy = FALSE,
+ interval = c(-1, 0.999), tol.solve = 1e-10, tol.opt = .Machine$double.eps^0.5)
+}
+\arguments{
+  \item{formula}{a description of the model to be fit }
+  \item{data}{an object of class \code{\link{data.frame}} or \code{pdata.frame}. An optional data frame containing the variables
+  in the model. When the obect is a \code{\link{data.frame}}, the first two columns may contain the indexes. See \code{index}}
+  \item{index}{if not NULL (default), a character vector to identify the indexes among the columns of the \code{\link{data.frame}}}
+  \item{listw}{an object of class \code{listw} created for example by \code{nb2listw}}
+  \item{model}{one of \code{c("lag","error")} }
+  \item{effects}{one of \code{"pooled"} (no spatial effects, i.e. OLS on the pooled model),
+  \code{"spfe"} (only spatial fixed effects), \code{"tpfe"} (only time period fixed effects),
+  \code{"sptpfe"} (both time period and spatial fixed effects)}
+  \item{method}{\code{"eigen"} (default) - the Jacobian is computed as
+  \eqn{\prod_{i=1}^N (1 - \rho \omega_i) } (with \eqn{\omega_i} the eigenvalues of the spatial
+  weigths matrix) using \code{eigenw}, and \code{"spam"} or \code{"Matrix"} using code from the spam or Matrix
+  packages to calculate the determinant (see \code{lagsarlm} for details)}
+  \item{na.action}{a function (default \code{na.fail}), can also be \code{na.omit} or \code{na.exclude} with consequences
+  for residuals and fitted values - (see \code{lagsarlm} for details)}
+  \item{quiet}{default=\code{TRUE}; if \code{FALSE}, reports function values during optimization}
+ \item{zero.policy}{if \code{TRUE} assign zero to the lagged value of zones without neighbours,
+if \code{FALSE} (default) assign NA - causing \code{spfeml} to terminate with an error}
+  \item{interval}{search interval for spatial parameter when not using \code{method="eigen"};
+  default is c(-1,1); \code{method="Matrix"} will attempt to search for an appropriate interval}
+  \item{tol.solve}{tolerance for detecting linear dependence in the columns of matrices to be inverted
+  (default= 1.0e-10)- (see \code{lagsarlm} for details)}
+  \item{tol.opt}{desired accuracy for optimization
+  (default=square root of double precision machine tolerance)}
+}
+
+
+\details{
+The function deals with both fixed effects spatial lag and error models, of the form:
+
+\deqn{ y = \rho (I_T \otimes W_N)y + (\iota_T \otimes \alpha) + X\beta + \epsilon }
+
+where \eqn{\rho} is called the spatial autoregressive coefficient, and:
+\deqn{ y =  (\iota_T \otimes \alpha) + X\beta + u }
+\deqn{ u =  \lambda (\iota_T \otimes W_N)u + \epsilon}
+
+respectively, where \eqn{\lambda} is the spatial autocorrelation coefficient.
+Both \eqn{\rho} and \eqn{\lambda} are found by \code{\link{optimize}},
+and the model parameters by a feasible GLS procedure.
+
+The asymptotic standard error of
+\eqn{\rho} is only computed when
+\code{method=eigen}, because the full matrix
+operations involved would be costly for
+dimensions associated with the choice of \code{"spam"} or \code{"Matrix"}.
+The same applies to the coefficient covariance matrix.
+
+The model variables are first transformed depending on the
+typology of fixed effects. As an example, if time period
+fixed effects are considered, the demeaned form is obtained
+by subtracting the average for each cross-sectional unit computed over the time
+dimension.
+
+The transformed variables are then used in a concentrated likelihood
+approach to estimate the spatial parameters.
+
+Once the spatial parameters are obtained, the model parameters are
+then estimated by a feasible GLS procedure.
+
+Fixed effects can then be extracted using the function \code{\link{effects}}.
+}
+
+
+\value{
+  An object of class \code{"splm"}.
+  \item{coefficients}{coefficients estimate of the model parameters }
+  \item{vcov}{the asymptotic variance covariance matrix of the estimated coefficients (when calculated)}
+  \item{type}{'fixed effects spatial lag (or error) model'}
+  \item{spat.coeff}{the spatial coefficients \eqn{\rho} or \eqn{\lambda} }
+  \item{residuals}{the GLS residuals}
+  \item{fitted.values}{difference between response variable and residuals}
+  \item{sigma2}{GLS residuals variance}
+  \item{model}{the matrix of the data used}
+  \item{call}{the call used to create the object}
+  \item{logLik}{the value of the log likelihood function at the optimum }
+  \item{method}{the method used to calculate the Jacobian}
+  \item{effects}{the typology of effects included in the model}
+  \item{res.eff}{a list whose elements are the fixed effects (see \code{\link{effects}})}
+
+}
+
+\references{
+  Elhorst, J.P. (2003)
+Specification and estimation of spatial panel data models,
+    \emph{International Regional Science Review}, \bold{26}, pages 244--268.
+
+  Elhorst, J.P. (2009)
+Spatial panel data models,
+    \emph{In} Fischer, M.M. and Getis, A. (eds),
+    \emph{Handbook of Applied Spatial Analysis} Springer, Berlin.
+
+Anselin, L. and Le Gallo, J. and Jayet, H. (2008)
+Spatial Panel Econometrics, \emph{In}
+Matyas, L. and Sevestre, P. (eds), \emph{The econometrics of Panel
+Data, Fundamentals and Recent Developments in Theory and Practice (3rd
+Edition)}, pages 624--660. Springer-Verlag, Berlin Heidelberg.
+}
+
+\author{ Gianfranco Piras \email{gpiras at mac.com}}
+
+\seealso{
+  \code{\link{spreml}}, \code{\link{spregm}}, \code{\link{effects}}
+}
+\examples{
+data(Produc, package = "Ecdat")
+data(usaww)
+Produc <- Produc[Produc$year<1975, ]
+fm <- log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp
+lag <- spfeml(fm, data = Produc, listw = mat2listw(usaww), effects = "sptpfe", method = "eigen", quiet = TRUE)
+summary(lag)
+eff <- effects(lag)
+err <- spfeml(fm, data = Produc, listw = mat2listw(usaww), model = "error", effects = "tpfe", method = "eigen", quiet = TRUE)
+summary(err)
+eff <- effects(err)
+print(eff)
+write.effects.splm(eff)
+}
+
+\keyword{spatial}
\ No newline at end of file


Property changes on: pkg/man/spfeml.Rd
___________________________________________________________________
Name: svn:executable
   + 

Added: pkg/man/splm-package.Rd
===================================================================
--- pkg/man/splm-package.Rd	                        (rev 0)
+++ pkg/man/splm-package.Rd	2009-10-21 19:57:57 UTC (rev 54)
@@ -0,0 +1,83 @@
+\name{splm-package}
+\alias{splm-package}
+\alias{splm}
+\docType{package}
+\title{
+Spatial panel models: estimation and testing
+}
+\description{
+A comprehensive toolset for ML and GM estimation and diagnostic testing of econometric models for spatial panel data.
+}
+\details{
+\tabular{ll}{
+Package: \tab splm\cr
+Type: \tab Package\cr
+Version: \tab 0.0\cr
+Date: \tab 2009-07-29\cr
+License: \tab GPL\cr
+LazyLoad: \tab yes\cr
+}
+}
+
+\author{
+Giovanni Millo and Gianfranco Piras
+
+Maintainer: Giovanni Millo <giovanni.millo at generali.com>
+}
+
+\references{
+Anselin, L. and Le Gallo, J. and Jayet, H. (2008)
+Spatial Panel Econometrics, \emph{In}
+Matyas, L. and Sevestre, P. (eds), \emph{The econometrics of Panel
+Data, Fundamentals and Recent Developments in Theory and Practice (3rd
+Edition)}, pages 624--660. Springer-Verlag, Berlin Heidelberg.
+
+Baltagi, B.H., Song, S.H., Jung B. and Koh, W. (2007)
+Testing panel data regression models with spatial and serial error correlation.
+\emph{Journal of Econometrics}, \bold{140}, 5-51.
+
+Baltagi, B.H., Song, S.H. and Koh, W. (2003)
+Testing panel data regression models with spatial error correlation.
+\emph{Journal of Econometrics}, \bold{117}, 123--150.
+
+  Elhorst, J.P. (2003)
+Specification and estimation of spatial panel data models,
+    \emph{International Regional Science Review}, \bold{26}, pages 244--268.
+
+  Elhorst, J.P. (2009)
+Spatial panel data models,
+    \emph{In} Fischer, M.M. and Getis, A. (eds),
+    \emph{Handbook of Applied Spatial Analysis} Springer, Berlin.
+
+  Kapoor, M., Kelejian, H.H. and Prucha, I.R. (2007) 
+  Panel data model with spatially correlated error components,
+    \emph{Journal of Econometrics}, \bold{140}, pages 97--130. 
+    
+  Kelejian, H.H. and Prucha, I.R. (1999) 
+A Generalized Moments Estimator for the Autoregressive Parameter in a Spatial Model,
+    \emph{International Economic Review}, \bold{40}, pages 509--533.
+    
+      Kelejian, H.H. and Prucha, I.R. (1999) 
+A Generalized Spatial Two Stage Least Square Procedure for Estimating a Spatial Autoregressive
+Model with Autoregressive Disturbances,
+    \emph{Journal of Real Estate Finance and Economics}, \bold{17}, pages 99--121.
+
+  Kelejian, H.H. and Prucha, I.R. (2004) 
+Estimation of Simultaneous systems of spatially interrelated cross sectional equations,
+    \emph{Journal of Econometrics}, \bold{118}, pages 27--50.
+}
+
+
+\keyword{ package }
+
+\examples{
+data(Produc, package = "Ecdat") 
+data(usaww)
+Produc <- Produc[Produc$year<1975, ] 
+fm <- log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp
+GM<-spregm(log(gsp)~log(pcap)+log(pc)+log(emp)+unemp, data=Produc,w=usaww,method="fulweigh")
+summary(GM)
+respaterr <- spreml(fm, data = Produc, w = usaww, errors="semre")
+summary(respaterr)
+
+}


Property changes on: pkg/man/splm-package.Rd
___________________________________________________________________
Name: svn:executable
   + 

Added: pkg/man/spregm.Rd
===================================================================
--- pkg/man/spregm.Rd	                        (rev 0)
+++ pkg/man/spregm.Rd	2009-10-21 19:57:57 UTC (rev 54)
@@ -0,0 +1,99 @@
+\name{spregm}
+\alias{spregm}
+\title{GM estimator for spatial panel data models}
+
+\description{GM estimator for panel data models with spatially correlated 
+errors components of the form: 
+
+\deqn{ y_N(t) = X_N(t) \beta + u_N(t) }
+
+\deqn{ u_N(t) = \rho W_N u_N(t) + \epsilon(t)}
+
+\deqn{ \epsilon_N = (e_T \otimes I_N ) \mu_N + \nu_N }
+
+where \eqn{ \rho}, and the variance components \eqn{\sigma^2_\mu} and \eqn{\sigma^2_\nu} 
+are estimated by GM, and the model coefficients by GLS. 
+}
+
+\usage{
+spregm(formula, data=list(), index=NULL, w, method = c("init", "weigh", "fulweigh"))
+}
+
+\arguments{
+  \item{formula}{a description of the model to be fit. The details of model specification are given
+  for \code{lm} }
+  \item{data}{an object of class \code{\link{data.frame}} or \code{pdata.frame}. An optional data frame containing the variables
+  in the model. When the obect is a \code{\link{data.frame}}, the first two columns may contain the indexes. See \code{index}}
+  \item{index}{if not NULL (default), a character vector to identify the indexes among the columns of the \code{\link{data.frame}}}
+  \item{w}{an object of class \code{listw} created for example by \code{nb2listw}. 
+  If a \code{matrix} is given as input the function will transform it using \code{mat2listw}}
+  \item{method}{\code{"init"} (default) defines the set of GM estimator to be used. Alternatives are  
+  \code{"weigh"} and \code{"fulweigh"} (See Details)}
+}
+
+
+\details{ When method=init, the initial estimator is calculated. This first set 
+of GM estimators is based only on a subset of the moments conditions and assigns 
+equal weigths to each of them. 
+When method=fulweigh, the second set of GM estimators is calculated. This estimator 
+is based on the full set of moments conditions. It also involves the expression for the variance 
+covariance matrix of the sample moments calculated under the assumption of 
+normally distributed innovations. The calculation of the trace terms in the expression 
+of the variance covariance matrix of the sample moments 
+uses codes from the \code{\link{Matrix}} package. 
+When method=weigh, the third set of GM estimator is used. This is motivated by computational 
+issues. The procedure is analogous to the second one but uses a simplified expression for the 
+variance covariance matrix of the sample moments
+
+Note that \eqn{\sigma^2_\mu} is not reported. \eqn{\sigma^2_1} is reported instead. 
+However, a value for \eqn{\sigma^2_\mu} can easily be obtained from:
+\deqn{\sigma^2_1 = \sigma^2_\nu + T \sigma^2_\mu}
+
+The function also produces an estimate for \eqn{\theta} which is a
+function of the variance components.
+}
+
+
+\value{
+  An object of class \code{"splm"}.
+  \item{coefficients}{GLS coefficients estimate of the model parameters}
+  \item{vcov}{the variance covariance matrix of the estimated coefficients}
+  \item{residuals}{the GLS residuals}
+  \item{fitted.values}{difference between response variable and residuals}
+  \item{sigma2}{GLS residuals variance}
+  \item{type}{'random effect GM'}
+  \item{rho}{a vector including the spatial parameter and the variance components (see Details)}  
+  \item{model}{the matrix of the data used}
+  \item{call}{the call used to create the object}
+}
+
+\references{
+  Kapoor, M., Kelejian, H.H. and Prucha, I.R. (2007) 
+  Panel data model with spatially correlated error components,
+    \emph{Journal of Econometrics}, \bold{140}, pages 97--130. 
+    
+  Kelejian, H.H. and Prucha, I.R. (1999) 
+A Generalized Moments Estimator for the Autoregressive Parameter in a Spatial Model,
+    \emph{International Economic Review}, \bold{40}, pages 509--533.
+    
+      Kelejian, H.H. and Prucha, I.R. (1999) 
+A Generalized Spatial Two Stage Least Square Procedure for Estimating a Spatial Autoregressive
+Model with Autoregressive Disturbances,
+    \emph{Journal of Real Estate Finance and Economics}, \bold{17}, pages 99--121.
+
+}
+
+\author{ Gianfranco Piras \email{gpiras at mac.com}}
+
+\seealso{
+  \code{\link{spreml}}, \code{\link{spsegm}}
+}
+\examples{
+data(Produc, package = "Ecdat") 
+data(usaww)
+Produc <- Produc[Produc$year<1975, ] 
+GM<-spregm(log(gsp)~log(pcap)+log(pc)+log(emp)+unemp, data=Produc,w=usaww,method="fulweigh")
+summary(GM)
+}
+
+\keyword{spatial}
\ No newline at end of file


Property changes on: pkg/man/spregm.Rd
___________________________________________________________________
Name: svn:executable
   + 

Added: pkg/man/spreml.Rd
===================================================================
--- pkg/man/spreml.Rd	                        (rev 0)
+++ pkg/man/spreml.Rd	2009-10-21 19:57:57 UTC (rev 54)
@@ -0,0 +1,97 @@
+\name{spreml}
+\alias{spreml}
+\title{Spatial Panel Random Effects Model Estimation}
+\description{Maximum likelihood (ML) estimation of spatial random effects panel of the form:
+\deqn{
+ y_{it} = X'_{it} \beta + u_{it}, \phantom{cacca} i=1,\dots,N, t=1,\dots,T
+}
+with 
+\deqn{
+u_t=\mu +\varepsilon_t
+}
+and
+\deqn{
+\varepsilon_t=\lambda W \varepsilon_t+ \nu_t \phantom{cacca} \mathop{\rm{where}} \phantom{cacca} \nu_t=\rho \nu_{t-1} +e_t.
+}
+Depending on the restrictions on the vector of parameters one can
+differently combine error features giving rise to various nested
+specifications. 
+}
+
+
+\usage{
+spreml(formula, data, index = NULL, w, lag=FALSE,
+           errors = c("semsrre","semsr","srre","semre","re","sr","sem"),
+           pvar = FALSE, hess=FALSE, quiet=TRUE,
+           initval = c("zeros", "estimate"),
+           x.tol=1.5e-18, rel.tol=1e-15,
+           ...)}
+
+\arguments{
+  \item{formula}{a symbolic description of the model to be estimated}
+  \item{data}{an object of class \code{\link{data.frame}} or \code{pdata.frame}. An optional data frame containing the variables
+  in the model. When the obect is a \code{\link{data.frame}}, the first two columns may contain the indexes. See \code{index}}
+  \item{index}{if not NULL (default), a character vector to identify the indexes among the columns of the \code{\link{data.frame}}}
+  \item{w}{an object of class \code{listw} or a \code{matrix}}
+  \item{lag}{default=\code{FALSE}. If \code{TRUE}, a spatial lag of the dependent variable is added: Not yet implemented}
+  \item{errors}{one of \code{c("semsrre","semsr","srre","semre","re","sr","sem")}. See details.}
+  \item{pvar}{if \code{TRUE} the \code{pvar} function is called}
+  \item{hess}{if \code{TRUE} use numerical Hessian instead of GLS for the standard errors of the estimates}
+  \item{quiet}{if \code{FALSE} report function and parameters values during optimization}
+  \item{initval}{one of \code{c("zeros", "estimate")}, the initial values for the parameters. If \code{"zeros"} a vector of zeros is used. if \code{"estimate"} the initial 
+  values are retreived from the estimation of the nested specifications. Alternatively, a numeric vector can be specified.}
+  \item{x.tol}{Tolerance. See \code{\link{nlminb}} for details. }
+  \item{rel.tol}{Relative tolerance. See \code{\link{nlminb}} for details. }
+  \item{...}{}
+}
+\details{
+  The models are estimated by two-step Maximum Likelihood.
+
+  The covariance structures allowed are:
+  \code{"semsr"} spatial and serial correlation in the idiosyncratic error
+    term; 
+  \code{"ssrre"} individual random effects and serial correlation;
+  \code{"semre"} individual random effects and spatial correlation;
+  \code{"re"} individual random effects;
+  \code{"ssr"} serial correlation;
+  \code{"sem"} spatial correlation.  
+}
+\value{
+  An object of class \code{"splm"}.
+  \item{coefficients}{coefficients estimate of the model parameters }
+  \item{arcoef}{the coefficient for the spatial lag on \code{y}}
+  \item{errcomp}{the estimates of the error variance components}
+  \item{vcov}{the asymptotic variance covariance matrix of the estimated coefficients}
+  \item{vcov.arcoef}{the asymptotic variance of the
+  estimated spatial lag parameter}
+  \item{vcov.errcomp}{the asymptotic variance covariance matrix of the
+  estimated error covariance parameters}
+  \item{type}{'random effects ML'}
+  \item{residuals}{the model residuals}
+  \item{fitted.values}{the fitted values, calculated as \code{\hat{y}=X \hat{\beta}}}
+  \item{sigma2}{GLS residuals variance}
+  \item{model}{the matrix of the data used}
+  \item{call}{the call used to create the object}
+  \item{logLik}{the value of the log likelihood function at the optimum }
+  \item{errors}{the value of the \code{errors} argument}
+}
+\references{
+Baltagi, B.H., Song, S.H., Jung B. and Koh, W. (2007)
+Testing panel data regression models with spatial and serial error correlation.
+\emph{Journal of Econometrics}, \bold{140}, 5-51.
+}
+
+\author{Giovanni Millo}
+
+\seealso{\code{\link{spregm}}, \code{\link{spfeml}}}
+
+\examples{
+data(Produc, package = "Ecdat")
+data(usaww)
+Produc <- Produc[Produc$year<1974, ]
+fm <- log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp
+respaterr <- spreml(fm, data = Produc, w = usaww, errors="semre")
+summary(respaterr)
+}
+
+\keyword{spatial}
\ No newline at end of file


Property changes on: pkg/man/spreml.Rd
___________________________________________________________________
Name: svn:executable
   + 

Added: pkg/man/spsegm.Rd
===================================================================
--- pkg/man/spsegm.Rd	                        (rev 0)
+++ pkg/man/spsegm.Rd	2009-10-21 19:57:57 UTC (rev 54)
@@ -0,0 +1,123 @@
+\name{spsegm}
+\alias{spsegm}
+\title{Spatial Simultaneous Equations}
+
+\description{Feasible generalized three stages least square estimator (FGS3SLS)
+of symultaneous systems of spatially interrelated cross sectional equations of the form: 
+
+\deqn{Y = Y B + X C +  \bar{Y} L + U}
+
+\deqn{ U = \bar{U} R + E}
+
+with \eqn{Y = (y_1,\dots,y_m)}, 
+\eqn{X = (x_1,\dots,x_m)}, \eqn{U = (u_1,\dots,u_m)}, 
+\eqn{\bar{Y} = (\bar{y}_1,\dots,\bar{y}_m)} 
+and \eqn{\bar{y}_j = W y_j} \eqn{j=1,\dots,m}, 
+\eqn{E = (e_1,\dots,e_m)}, \eqn{\bar{U} = (\bar{u}_1,\dots,\bar{u}_m)} 
+and \eqn{\bar{u}_j = W u_j} \eqn{j=1,\dots,m}. 
+B, C, L and \eqn{R=diag_{j=1}^m (\rho_j)} 
+are matrix of parameters
+
+
+}
+
+\usage{
+spsegm(formula,data=list(), spec='default', listw, method='spatialsim',zero.policy = FALSE)
+}
+\arguments{
+  \item{formula}{an object of class \code{formula} (see Details)}
+  \item{data}{an object of class \code{\link{data.frame}}. An optional data frame containing the variables
+  in the model}
+  \item{spec}{a list used to define the specification (see Details) }
+  \item{listw}{an object of class \code{listw} created for example by \code{nb2listw}}
+  \item{method}{\code{spatialsim}}
+  \item{zero.policy}{See \code{lagsarlm} for details}
+}
+
+
+\details{
+The function can be specified with any number of equations. 
+The number of equations is determined through the \code{formula} object.
+In particular, all the responses for all equations should be organized in a matrix and
+specified on the left hand side of the formula object. Analogously, all the explanatory 
+variables from all equations should be specified on the right hand side of the 
+formula. The number of equations is then retrieved from the dimension of the matrix 
+containing the responses.
+
+The argument \code{spec} should either be \code{default} or a \code{list}.
+When \code{spec="default"}, all the equations in the system have the same explanatory variables 
+(including the intercept). The intercept can be eliminated (for all the equations at the same time)
+as it is done in \code{lm}. 
+
+When \code{spec=list} it should have the same length as the number of equations (i.e.
+the number of columns of y in the formula object). The presence of the intercept is managed 
+by \code{spec} (see Examples). When trying to eliminate the intercept in the classical way, if 
+\code{spec} is a list an error message will occour. 
+
+}
+
+
+\value{
+  An object of class \code{"splm"}.
+  \item{coefficients}{FG3SLS coefficients estimate of the model parameters (for all equations)}
+  \item{vcov}{the variance covariance matrix of the estimated coefficients}
+  \item{type}{'spsegm'}
+  \item{model}{the matrix of the data used (responses in each equation are reported first, then the 
+  explanatory variables)}
+  \item{N}{the number of cross-sectional observations}  
+  \item{Eq}{the number of equations in the system}  
+  \item{k}{the number of columns of the matrix of regressors 
+  (i.e. this corresponds to the number of explanatory variables in each equation only when 
+  \code{spec="default"})}
+  \item{call}{the call used to create the object}
+  \item{terms}{the \code{terms} object generated from \code{formula} and some optional arguments}
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/splm -r 54


More information about the Splm-commits mailing list