[Rsiena-help] Transform 1-mode edgelist to adjacency matrix (Daniel Stefan Hain)
Christoph Stich
christoph.stich at gmx.at
Fri Nov 30 12:41:27 CET 2012
Dear Daniel,
The SIENA Manual actually provides instructions of who to deal with the
problem of leaving and joining actors. The relevant sections are "4.1.2
Structurally determined values" and "4.8 Composition change: joiners and
leavers". In general, you either specify an actor as absent from the
network by setting the value of his ties as "structural zeros", you set
ties of absent actors to missing or you specify absent actors with
sienaCompositionChangeFromFile or sienaCompositionChange.
If I understand you correctly you transform your adjacency matrix into
an igraph object, subset for your desired attributes, then back into an
adjacency matrix and on the way you lose some of your actors? You could
insert rows and columns by hand (insertCol and insertRow from the
micEcon package do that), but that seems rather cumbersome. Have you
tried subsetting your ties directly from the adjacency matrix? Maybe
transforming your year attribute in an attribute matrix and then using
that to subset your original matrix?
Hope that helps,
Christoph Stich
MSc candidate Urban Studies, University of Amsterdam
On Fri, Nov 30, 2012 at 3:00 AM,
<rsiena-help-request at lists.r-forge.r-project.org
<mailto:rsiena-help-request at lists.r-forge.r-project.org>> wrote:
Send Rsiena-help mailing list submissions to
rsiena-help at lists.r-forge.r-project.org
<mailto:rsiena-help at lists.r-forge.r-project.org>
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rsiena-help
or, via email, send a message with subject or body 'help' to
rsiena-help-request at lists.r-forge.r-project.org
<mailto:rsiena-help-request at lists.r-forge.r-project.org>
You can reach the person managing the list at
rsiena-help-owner at lists.r-forge.r-project.org
<mailto:rsiena-help-owner at lists.r-forge.r-project.org>
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Rsiena-help digest..."
Today's Topics:
1. Transform 1-mode edgelist to adjacency matrix (Daniel Stefan
Hain)
----------------------------------------------------------------------
Message: 1
Date: Thu, 29 Nov 2012 15:24:03 +0000
From: Daniel Stefan Hain <dsh at business.aau.dk
<mailto:dsh at business.aau.dk>>
To: "rsiena-help at lists.r-forge.r-project.org
<mailto:rsiena-help at lists.r-forge.r-project.org>"
<rsiena-help at lists.r-forge.r-project.org
<mailto:rsiena-help at lists.r-forge.r-project.org>>
Subject: [Rsiena-help] Transform 1-mode edgelist to adjacency matrix
Message-ID:
<5C7C94834D71E144B9351830389C46BCFCDBFFC1 at AD-EXCHMBX2-4.aau.dk
<mailto:5C7C94834D71E144B9351830389C46BCFCDBFFC1 at AD-EXCHMBX2-4.aau.dk>>
Content-Type: text/plain; charset="iso-8859-1"
Hi dear RSiena community,
I currently have the following problem. I am conducting a dynamic
analysis on cooperation in research project on basis of a directed
edgelist that looks like follows:
"Project leader" "Project partner" "Year"
"Some more attributes"
Firm X Firm Y
2000
Firm A Firm X 2005
...
I want to divide the dataset into 3-4 subsets for different periods,
lets say 2000-2002, 2003- 2005 ect. That's not the challenge
(subseting in [R]), but then my problem is the following:
1.: How can I create a directed and weighted adjacency matrix out of
this data structure for every single time period? Up to now I
managed it with transforming it to an IGraph object and then back
into an adjacency matrix. That works, but the resulting matrix for
the selected timeframe does not contain all actors from the whole
dataset, thus the resulting adjacency matrixes as input for RSiena
all have different dimensions.
I up to now worked with 2-mode edgelists, there I just could
tabulate the dataframe and multiply it with the transposed one to
get the adjacency matrix. When I used subsets for the different time
period, I could exploit the fact that R still keeps the index of
everything that drops out of the subset, but shows up in the
cross-tab and therefore in the adjacency again.
With a 1-mode edgelist it obviously does not work. Any advice is
appreciated!
Vest wishes
Daniel S. Hain
PhD Fellow, M.Sc. Economics, Dipl.-Wirt.-Ing.
_______________________________________
Innovation, Knowledge and Economic Dynamics (IKE) Group
Strategic Research Alliance for Energy Innovation Systems (EIS)
Department of Business and Management
Aalborg University
Fibigerstraede 4, Room 16a
9220 Aalborg ?st, Denmark
Tel.: +45 9940 2724
Email: dsh at business.aau.dk
<mailto:dsh at business.aau.dk><mailto:dsh at business.aau.dk
<mailto:dsh at business.aau.dk>>
Web: www.business.aau.dk
<http://www.business.aau.dk><http://www.business.aau.dk>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.r-forge.r-project.org/pipermail/rsiena-help/attachments/20121129/ba8c60bd/attachment-0001.html>
------------------------------
_______________________________________________
Rsiena-help mailing list
Rsiena-help at lists.r-forge.r-project.org
<mailto:Rsiena-help at lists.r-forge.r-project.org>
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rsiena-help
End of Rsiena-help Digest, Vol 28, Issue 1
******************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rsiena-help/attachments/20121130/a708fab5/attachment.html>
More information about the Rsiena-help
mailing list