[R-sig-Geo] lAGRANGE MULTIPLIER Test and error in listw object
az14
abidi.zineb at gmail.com
Tue May 6 11:10:14 CEST 2014
Dear List,
I 'm trying to run the Lagrange multiplier test (LM Test) using R.
so i import my data file(don) and do an lm regression as bellow:
don<-read.csv("donnees2.csv",header=TRUE,sep=";",dec=",")widad.lm<-lm(coop~dens_t1+perchom_t1+percvieux_t1+psdc_t1,data=don)
> summary(widad.lm)
Then i import my distance matrix( 1056*1056).
matrice<-read.csv("matw2.csv",header=FALSEE,sep=";",dec=",")
mat<-do.call(rbind,matrice)
dim(mat)
is.matrix(mat)
True
mat2<-mat%*%mat
> dim(mat2)
[1] 1056 1056
> x <- mat2listw(mat2)
When i run the LM test; with an nb2listw object, i get this error:
lm.LMtests(widad.lm,nb2listw(x$neighbours, glist=x$weights,
style="W"),test=c("LMerr","RLMerr"))
Erreur dans subset.listw(listw, subset, zero.policy = zero.policy) :
/Not yet able to subset general weights lists
I tryed to do it with mat2listw, but i get error too.
lm.LMtests(widad.lm, mat2listw(mat2),test=c("LMerr","RLMerr"))
Erreur dans subset.listw(listw, subset, zero.policy = zero.policy) :
Not yet able to subset general weights lists
Any help would be appreciated.
Thank you.
Zineb.
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/lAGRANGE-MULTIPLIER-Test-and-error-in-listw-object-tp7586372.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
More information about the R-sig-Geo
mailing list