user3693016
user3693016

Reputation: 61

How does one feed non-edge dyad attributes into a network object in R?

I'm trying to work with objects of the class ``network'' (the network package). I noticed that edgelist easily handles dyadic attributes, but it is unclear how to give R information about dyadic attributes for those dyads for which an edge does not exist. Obviously ignoring this data will bias my coefficients in further statistical analysis. Has anyone encountered this problem and have any advice?

Example: Say I have a network (1,...,5). An edgelist matrix, I think, would have columns of the node IDs, along with edge covariates (here, suppose unemployment rate of countries or something, with an edge meaning whether they have a treaty)

myedgelist:

1 3 .08

2 4 .06

2 5 .1

3 5 .04

I could then do some stats on this, and throw in the (edit:) unemployment covariate. But I dont see a way to throw in the trade data for non-edge dyads (1 and 2, for instance).

UPDATE: The edgelist is what's connected. The network object would be defined as

object <- network(myedgelist,matrix.type = "edgelist", directed=F)

Upvotes: 0

Views: 226

Answers (2)

skyebend
skyebend

Reputation: 1109

Edge attributes/coviariates can only be attached to an edge in the network. You could either implement this using multiple networks as user3693016, or as a single "multiplex" network (network with multiple types of edges). The off which option is better will depend on what you are trying to do with the network.

Upvotes: 0

user3693016
user3693016

Reputation: 61

It you have different sets of connection between objects, I meant you would actually create multiple network objects each with different edgelists. I'm not sure exactly how you're doing your "analysis". But you could also also create one network where all "related" vertices have an edge if they have a dyadic attribute. Then things like "has treaty" can be a 0/1 valued edge attribute and the trade in trillions can be a different attribute on that same edge. – MrFlick Jun 1 at 18:27

Upvotes: 0

Related Questions