[Splm-commits] r207 - in pkg: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jan 12 17:16:48 CET 2016


Author: the_sculler
Date: 2016-01-12 17:16:47 +0100 (Tue, 12 Jan 2016)
New Revision: 207

Modified:
   pkg/ChangeLog
   pkg/DESCRIPTION
   pkg/R/bsktest.R
   pkg/man/bsktest.Rd
Log:
Temporarily disabled SLM1-2 tests in bsktest.R. Fixed example of bsktest.Rd to 'standardize=FALSE'


Modified: pkg/ChangeLog
===================================================================
--- pkg/ChangeLog	2016-01-12 15:22:52 UTC (rev 206)
+++ pkg/ChangeLog	2016-01-12 16:16:47 UTC (rev 207)
@@ -1,3 +1,6 @@
+Changes in Version 1.4-4
+ o Fixed clmmtest() in bsktest.R (now takes residuals for the restricted model from spreml(..., errors="sem", lag=F) instead of spfeml()). Temporarily disabled standardized LM tests SLM1 and SLM2; default set at 'standardize=FALSE'in main function.
+	
 Changes in Version 1.4-3
  o Introduced Baltagi et al. C.3 test (RE conditional on SEM and AR(1)) after successful testing.
 

Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2016-01-12 15:22:52 UTC (rev 206)
+++ pkg/DESCRIPTION	2016-01-12 16:16:47 UTC (rev 207)
@@ -1,6 +1,6 @@
 Package: splm
 Title: Econometric Models for Spatial Panel Data
-Version: 1.4-3
+Version: 1.4-4
 Date: 2016-01-12
 Authors at R: c(person(given = "Giovanni", family = "Millo", role = c("aut", "cre"), email = "giovanni.millo at generali.com"),
              person(given = "Gianfranco", family = "Piras", role = c("aut"), email = "gpiras at mac.com"))

Modified: pkg/R/bsktest.R
===================================================================
--- pkg/R/bsktest.R	2016-01-12 15:22:52 UTC (rev 206)
+++ pkg/R/bsktest.R	2016-01-12 16:16:47 UTC (rev 207)
@@ -17,7 +17,7 @@
 `bsktest.formula` <-
 function(x, data, index=NULL, listw,
          test=c("LMH","LM1","LM2","CLMlambda","CLMmu"),
-         standardize=TRUE, method = "eigen", ...){
+         standardize=FALSE, method = "eigen", ...){
   
 switch(match.arg(test), LM1 = {
 
@@ -249,8 +249,10 @@
 
 
 `slm1test` <-
-function(formula, data, index=NULL, listw, standardize, ...){
-
+function(formula, data, index=NULL, listw, standardize, ...){
+    ## temporary switch because of bad results in SLM1
+    if(standardize) stop("Standardized SLM1 test temporarily unavailable: \n use 'standardize=FALSE' for LM1 test instead")
+    
   if(!is.null(index)) { ####can be deleted when using the wrapper
     #require(plm)
     data <- plm.data(data, index)
@@ -343,8 +345,9 @@
 
 
 `slm2test` <-
-function(formula, data, index=NULL, listw, standardize, ...){
-
+function(formula, data, index=NULL, listw, standardize, ...){
+    if(standardize) stop("Standardized SLM2 test temporarily unavailable: \n use 'standardize=FALSE' for LM2 test instead")
+                                              
   if(!is.null(index)) { 
     #require(plm)
     data <- plm.data(data, index)
@@ -533,8 +536,13 @@
 `clmmtest` <-
 function(formula, data, index=NULL, listw, method, ...){
 
-ml <- spfeml(formula=formula, data=data, index=index, listw=listw, model="error", effects="pooling", method = method)
-
+##ml <- spfeml(formula=formula, data=data, index=index, listw=listw, model="error", effects="pooling", method = method)
+
+    ## modified for obtaining correct residuals
+    ## (spfeml omitted the intercept)
+    ml <- spreml(formula=formula, data=data, index=index, w=listw,
+                 errors="sem", lag=F)
+                                                        
 	 if(!is.null(index)) {
     data <- plm.data(data, index)
     }
@@ -562,8 +570,9 @@
 	ind1<-seq(1,N)
 	inde1<-as.numeric(rep(ind1,T))
 
-	lambda<-ml$spat.coef
-	eML<-residuals(ml)
+	lambda <- ml$errcomp["rho"] # was: ml$spat.coef,
+                                    # modified for use with spreml
+        eML<-residuals(ml)
 
  	Ws<-listw2dgCMatrix(listw)
 	Wst<-t(Ws)

Modified: pkg/man/bsktest.Rd
===================================================================
--- pkg/man/bsktest.Rd	2016-01-12 15:22:52 UTC (rev 206)
+++ pkg/man/bsktest.Rd	2016-01-12 16:16:47 UTC (rev 207)
@@ -11,7 +11,7 @@
 bsktest(x,...)
 \method{bsktest}{formula}(x, data, index=NULL, listw,
 test=c("LMH","LM1","LM2","CLMlambda","CLMmu"), 
-standardize=TRUE, method = "eigen", ...)
+standardize=FALSE, method = "eigen", ...)
 }
 \arguments{
 \item{x}{a \code{formula}}
@@ -45,7 +45,7 @@
 data(usaww)
 fm <- log(gsp)~log(pcap)+log(pc)+log(emp)+unemp
 bsktest(fm,data=Produc, listw = mat2listw(usaww),
-  test="LM1", standardize=TRUE)
+  test="LM1")
 }
 
 \keyword{htest}



More information about the Splm-commits mailing list