Dear colleagues,



as promised, attached please find a summary to the responses received for my question stated below. Thanks again to Kathleen, Roger and Michal for their help - I really appreciate your support!



Best,



Michael



I received one answer through R-sig-GEO as well as one through R-Help and one through SOCNET where I posted similar questions:



(1) SOCNET answer from Kathleen CARLEY: "You can use ORA. Using ORA you can directly link to access and pull in the data. Then you can calculate Moran's I."



(2) R-Help answer from from Roger Bivant: "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."



(3) R-sig-GEO answer from Michal Gallay: "I have recently used spdep for local and global Moran's I calculation, but with raster data.

nb.ob <- cell2nb(nrow=100, ncol=100, type="queen") # neighbourhood object nb.ob.w <- nb2listw(nb.ob, , style="W") #list of weights in the moving window glob.moran <-moran(my.raster.data, listw=nb.ob.w, n=length(nb.ob), S0=Szero(nb.ob.w), zero.policy=FALSE, NAOK=TRUE)

I would say you need spatial locations (either grid, polygons or points) of the observations to use spdep for Moran's I and as you are describing your data structure it does not seem so. Package vegan (HYPERLINK

"http://vegan.r-forge.r-project.org/<http://vegan.r-forge.r-project.org/http://vegan.r-forge.r-project.org/>http://vegan.r-forge.r-project.org/<http://vegan.r-forge.r-project.org/)%20is%20robust%20for%20similarity%20analysis,%20perhaps%20it%20would%20do%20for%20your%20research.>) is robust for similarity analysis, perhaps it would do for your research.



(4) I also found another solution myself: If data is available in the format Actor_1 - Actor_2 - Tie_strength one way is to copy the information from Access into a txt file (excluding column names) and to use the read.dat2listw function to create a file that can subsequently be used in the moran.mc function in spdep.





-----Ursprüngliche Nachricht-----

Von: Haenlein.Michael [mailto:Michael.Haenlein@whu.edu]

Gesendet: Monday, April 28, 2008 09:38

An: r-sig-geo@stat.math.ethz.ch

Betreff: Question regarding spdep package



Dear colleagues,

my name is Michael Haenlein and I am Assistant Professor of Marketing at the ESCP-EAP European School of Management in Paris, France. My question deals with the spdep package, essentially how I can transform my data into a neighbors list object.

I am currently working on a research project in the area of social network analysis for which I would like to use the spdep package to calculate Moran's I. In this context I have a question regarding a transformation of my input data into a format suitable for spdep. My social network consisting of roughly 20,000 actors. The data describing this network is stored in an Access database in two separate tables: The first table includes the relationships between pairs of actors in the form: Actor1 - Actor 2 - Measure_of_distance_between_Actor1_and_Actor2. The second table includes information about each actor in the form: Actor_ID - Variable1 - Variable2 - ...





My objective is to see whether actors that are related to each other tend to have similarities in one of the variables (e.g. Variable1). I would like to do this by calculating a "Moran's I" statistic, which in my understanding is essentially a measure of network autocorrelation. Browsing the Internet, I found the "spdep package" that seems to be well suited for this task. However, my issue is that the "spdep package" has initially not been developed for social network analysis but for spatial statistics. Hence, the problem I'm having is that I do not know in which format I should import my data into R so that I can use it within the "spdep package". I am familiar with using R and know how to generally import data by using the read.csv function. The problem is that I do not know how I can get my data from above into a "neighbors list" format.





Does anyone have some experience with the "spdep package" and can point me into some direction?

Or is there another easier to use tool that I could use to do my "Moran's I" calculation?





Thanks very much for your help in advance.

I will post a list of all responses received to this question on the list.





Best,





Michael









Michael Haenlein

Professor of Marketing

ESCP-EAP European School of Management

79, Avenue de la République | 75011 Paris | France



	[[alternative HTML version deleted]]


