[Splm-commits] r175 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Jul 26 00:37:44 CEST 2013
Author: gpiras
Date: 2013-07-26 00:37:44 +0200 (Fri, 26 Jul 2013)
New Revision: 175
Modified:
pkg/R/impacts.splm.R
Log:
impacts
Modified: pkg/R/impacts.splm.R
===================================================================
--- pkg/R/impacts.splm.R 2013-07-25 17:37:58 UTC (rev 174)
+++ pkg/R/impacts.splm.R 2013-07-25 22:37:44 UTC (rev 175)
@@ -1,11 +1,13 @@
impacts.splm<-function(obj, listw = NULL, time = NULL, ..., tr=NULL, R=200, type="mult", empirical=FALSE, Q=NULL){
+if(is.null(listw) && is.null(tr)) stop("either listw or tr should be provided")
+
-if(!is.null(listw)){
+if(!is.null(listw) ){
if(listw$style != "W") stop("Only row-standardised weights supported")
if(is.null(time) && is.null(tr)) stop("time periods should be provided")
}
-else stop("listw object should be provided")
+
if(is.null(tr)){
sparse.W <- listw2dgCMatrix(listw)
More information about the Splm-commits
mailing list