Re: [R] spdep question - Moran's I

From: Roger Bivand <Roger.Bivand_at_nhh.no>
Date: Sat, 19 Apr 2008 21:27:00 +0000 (UTC)

Haenlein.Michael <Michael.Haenlein <at> whu.edu> writes:

>
> Dear all,
>
> I would like to calculate a Moran's I statistic using the moran function in
> the spdep package. The problem
> I'm having deals with how to create the listw object.
>
> My data stems from the area of social network analysis. I have list of poeple
> and for each pair of them I have a
> measure of their relationship strength. So my dataset looks like:
> Jim; Bob; 0.5
>
> This measure of relationship strength can be interpreted like a distance
> measure in a spatial model.
>
> I assume that I need to work with the nb2listw function, but I am lost
> what to do in detail.

If you have a data frame of from, to, weight, and possibly change the column names to suit the sn2listw() function, you might be able to move forward. The from-to strings would need to form a single set of names, where for Moran's I the resulting network may be asymmetric. If you start with a simple example, you can trace things through. If it is the case that sn2listw() wants integers not names, coerce the names (factor levels) to integer.

Perhaps the R-sig-geo list would be more suitable, even if this use is not spatial as such - there is a higher proportion of people there who might be able to help. Probably traceback() and debug(sn2listw) will be your friends in trying to have it do things it was not written for. If you make progress, please say so.

Hope this helps,

Roger

>
> Thanks very much for your help in advance!
>
> Michael Haenlein
> Assistant Professor of Marketing
> ESCP-EAP European School of Management
> Paris, France



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 19 Apr 2008 - 21:32:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 19 Apr 2008 - 22:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive