Skip to content

Export matrix weights to excel.

4 messages · Rolando Valdez, Roger Bivand

#
Hello,

I'm working with a matrix weights, I want to know if I can export the output, to handle with excel.

This is a part what I have:
OGR data source with driver: ESRI Shapefile 
Source: ".", layer: "zmdis"
with 56 features and 8 fields
Feature type: wkbPolygon with 2 dimensions
Characteristics of weights list object:
Neighbour list object:
Number of regions: 56 
Number of nonzero links: 86 
Percentage nonzero weights: 2.742347 
Average number of links: 1.535714 
21 regions with no links:
3 6 11 13 14 15 16 24 25 27 28 35 36 38 41 47 48 51 52 53 54
Link number distribution:

 0  1  2  3  4  5  8 
21 12 11  2  7  2  1 
12 least connected regions:
1 5 7 17 19 20 21 30 33 34 45 55 with 1 link
1 most connected region:
37 with 8 links

Weights style: W 
Weights constants summary:
   n   nn S0       S1    S2
W 35 1225 35 39.26667 147.3

I want to get a matrix [56 x 56] to work in excel with it.

Thank you in advance.

Rolando Valdez
#
On Sat, 3 May 2014, Rolando Valdez wrote:

            
?listw2mat should help, then write the matrix in a form that Excel can 
read. But note that your distance criterion leaves 21 of 56 observations 
with no neighbours.

Hope this helps,

Roger

  
    
#
Yes, I got it.

Now, I saw an issue in the matrix, I?ve got two regions with value 1 inside the matrix, if it is W style, how is it possible?. The rest of rows are standardized.

Another question, the output follow the order of regions of the shape file, isn?t?

Thank you
El 04/05/2014, a las 12:46, Roger Bivand <Roger.Bivand at nhh.no> escribi?:
Rolando Valdez
#
On Mon, 5 May 2014, Rolando Valdez wrote:

            
You can "see" it, nobody else can. Are all the rowSums() of the matrix 1? 
If so, two of the observations only have one neighbour (maybe a pair 
linked only to each other). Why would this be unexpected if you are using 
distance-based neighbours?
They follow the order of the coordinate matrix you passed to dnearneigh(), 
but you can check this easily enough.

Please do read the documentation, none of this is particularly difficult.

Roger