
Oi Elias. Pois é, olha só o que aparece: este.nb= read.gal("municipios.gal" , override.id=TRUE) print(este.nb)
print(este.nb) Neighbour list object: Number of regions: 5564 Number of nonzero links: 32228 Percentage nonzero weights: 0.104102 Average number of links: 5.792236 3 regions with no links:
######### w.nb<-nb2listw(este.nb,style="W", zero.policy=TRUE) | > print(w.nb, zero.policy=TRUE) Characteristics of weights list object: Neighbour list object: Number of regions: 5564 Number of nonzero links: 32228 Percentage nonzero weights: 0.104102 Average number of links: 5.792236 3 regions with no links: 3520400 5300108 2605459 Weights style: W Weights constants summary: n nn S0 S1 S2 W 5561 30924721 5561 2044.729 23174.73 | | | | | >w.nb ###se peço para aparecer o executado da erro como se vê abaixo Error in print.listw(x) : regions with no neighbours found, use zero.policy=TRUE Preciso desses pesos para calcular o indice de Moran da variavel Y, que nada mais do que o Renda municipal, usando matriz de pesos w.nb dados<-read.table("res.csv",sep=";",dec=",",header = TRUE) head(dados) | MUNICIPIO Y PIBa PIB cod 1 MANCIO LIMA 591239.9 33426.61 150136.08 1200336 2 MANOEL URBANO 58934.4 18044.54 80018.27 1200344 3 ASSIS BRASIL 1978559.5 17371.21 64601.58 1200054 4 FEIJO 285000.0 45966.75 267202.96 1200302 5 XAPURI 355711.4 55298.02 168708.32 1200708 6 TARAUACA 2852586.8 65297.63 335519.90 1200609 | | | | | > | | summary(dados) moran.test(dados$Y, listw=w.nb, randomisation=FALSE, alternative="greater",zero.policy=TRUE) Error in na.fail.default(x) : missing values in object | | Em Segunda-feira, 10 de Julho de 2017 15:22, Elias T. Krainski via R-br <r-br@listas.c3sl.ufpr.br> escreveu: Complementando: On 10/07/2017 15:20, Elias T. Krainski wrote:
nbw <- nb2listw(este.nb,style="W", zero.policy=TRUE) print(nbw, zero.policy=TRUE)
Elias _______________________________________________ R-br mailing list R-br@listas.c3sl.ufpr.br https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e fornea cdigo mnimo reproduzvel.