[Splm-commits] r109 - in pkg: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat May 7 18:56:50 CEST 2011


Author: the_sculler
Date: 2011-05-07 18:56:50 +0200 (Sat, 07 May 2011)
New Revision: 109

Modified:
   pkg/ChangeLog
   pkg/DESCRIPTION
   pkg/NAMESPACE
   pkg/R/bsktest.R
Log:
P-values for LMH test are now correctly generated from mixed chisquare.
Dependency on package 'ibdreg' added.  


Modified: pkg/ChangeLog
===================================================================
--- pkg/ChangeLog	2011-05-05 20:24:29 UTC (rev 108)
+++ pkg/ChangeLog	2011-05-07 16:56:50 UTC (rev 109)
@@ -1,3 +1,8 @@
+Changes in Version 0.8-03
+  o fixed the joint bsktest, pvalue comes now from pchibar{ibdreg}; added dependency on 'ibdreg' but nothing in NAMESPACE because 'ibdreg' doesn't have one
+Changes in Version 0.8-02
+  o fixed the bsktest, now only formula methods and correct pvals
+	
 Changes in Version 0.8-01
   o added the spatial hausman test
   o deleted bsjk test and corrected the bsk tests

Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2011-05-05 20:24:29 UTC (rev 108)
+++ pkg/DESCRIPTION	2011-05-07 16:56:50 UTC (rev 109)
@@ -1,10 +1,10 @@
 Package: splm
 Title: Econometric Models for Spatial Panel Data
-Version: 0.8-02
-Date: 2011-04-13
+Version: 0.8-03
+Date: 2011-05-06
 Author: Giovanni Millo <giovanni.millo at generali.com>, Gianfranco Piras <gpiras at mac.com>
 Maintainer: Giovanni Millo <giovanni.millo at generali.com>
 Description: ML and GM estimation and diagnostic testing of econometric models for spatial panel data.
-Depends: R (>= 2.11.1), MASS, nlme, spdep, plm, Matrix, bdsmatrix, spam
+Depends: R (>= 2.11.1), MASS, nlme, spdep, plm, Matrix, bdsmatrix, spam, ibdreg
 License: GPL-2
 LazyLoad: yes

Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE	2011-05-05 20:24:29 UTC (rev 108)
+++ pkg/NAMESPACE	2011-05-07 16:56:50 UTC (rev 109)
@@ -5,6 +5,7 @@
 importFrom(bdsmatrix,bdsmatrix)
 importFrom(MASS,ginv)
 
+
 export(bsktest, sphtest,
 effects.splm, print.effects.splm, write.effects.splm, 
 print.splm, spfeml, spgm, spreml, summary.splm, sphtest, listw2dgCMatrix)

Modified: pkg/R/bsktest.R
===================================================================
--- pkg/R/bsktest.R	2011-05-05 20:24:29 UTC (rev 108)
+++ pkg/R/bsktest.R	2011-05-07 16:56:50 UTC (rev 109)
@@ -439,6 +439,8 @@
 `LMHtest` <-
 function(formula, data, index=NULL, listw, ...){
     ## depends on listw2dgCMatrix.R
+  require(ibdreg) # for mixed chisquare distribution
+
   if(!is.null(index)) { ####can be deleted when using the wrapper
     require(plm)
     data <- plm.data(data, index)
@@ -512,18 +514,10 @@
 		if (LM2<=0) JOINT<-LM1^2
 		else JOINT<-LM1^2 + LM2^2
 		}
-		
-STAT<- qchisq(0.05,1,lower.tail=FALSE)
-STAT1<- qchisq(0.05,2,lower.tail=FALSE)
-if (JOINT>=2.952) {
-		if (JOINT<7.289 & JOINT>=4.321) pval<-0.05
-		if (JOINT >= 7.289) pval<-0.01
-		if (JOINT<= 4.321)	pval<-0.1
-	}
-else pval<-1
+  statistics<-JOINT
+  pval <- 1 - pchibar(statistics, df=0:2, wt=c(0.25,0.5,0.25))
+    
 
-	statistics<-JOINT
-
   names(statistics)="LM-H"
 	method<- "Baltagi, Song and Koh LM-H one-sided joint test"
 



More information about the Splm-commits mailing list