[R-sig-Geo] use nbcosts() with geographic openstreetmap distance as weights

Roger Bivand Roger@B|v@nd @end|ng |rom nhh@no
Thu Aug 5 10:17:04 CEST 2021


On Wed, 4 Aug 2021, Germán Gallego via R-sig-Geo wrote:

> I am conducting a study of Regionalization for the Ministry of Health of 
> Colombia, using a MST and SKATER algorithm proposed by Assauncao. I have 
> included 121 social and health covariates sumarized on a SImilarity 
> matrix (After Explratory Factor analysis dimensiionality treatment). 
> that will be used into skater function.
> I am using a spatialpolygons dataframe with the 1081 municipalities that 
> I've proccesed with nb2list() function. Also I have the geographic 
> distance (extracted from openstreetmaps) from each capital city to 
> anotherone, and I want to use it in nbcosts() function.  When I read the 
> nbcosts documentation I read that the data must be in dataframe class 
> object but what i have is a dist object. The code does not show any 
> error but im not sure how the dist object is computing it.
>> ady <- poly2nb(colpeso.utmsub)
>
>> adycostsdist <- nbcosts(ady,distkmat1)
>
>> class(distkmat1)
> [1] "dist"

> I suppose that I have to covert a dist object into a nbdist object? or 
> find the way to use it properly into nbcost function,

No, this is not a sensible way of using this approach. The data.frame 
should contain observations for the spatial objects on variables relevant 
for the regionalization being undertaken, not a distance matrix. These 
variables might be demographic, socio-economic, or others relevant to the 
regionalization. It is the "distance" in variable, not geographic, space 
that is used to weight the edges of the graph, so that less similar edges 
are dropped and more similar edges retained. The geographical distances 
between observations are implicit in the neighbour graph - see 
https://keen-swartz-3146c4.netlify.app/area.html#higher-order-neighbours 
for a discussion. Run example(skater) to see that four variables are used 
in the dpad data.frame.

Hope this clarifies,

Roger

> I'll apreciate your opinion on this. 
> Thank you in advance
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Emeritus Professor
Department of Economics, Norwegian School of Economics,
Postboks 3490 Ytre Sandviken, 5045 Bergen, Norway.
e-mail: Roger.Bivand using nhh.no
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en


More information about the R-sig-Geo mailing list