After leaving academia, it has been hard to find the time to do this research. Have a look at comment #40 on this page: https://toreopsahl.com/2010/04/21/article-node-centrality-in-weighted-networks-generalizing-degree-and-shortest-paths/ for a suggestion on how to set up this problem.

Let me know what you find!

Best,

Tore

Hi Tore,

thanks again for your quick response – this makes sense. Have you had a chance to work on the optimal value of alpha as indicated in your Social Networks (2010) paper?

Best,

Sebastian

Hi Sebastian,

The degree_tm-function calculates the node strength of two mode networks. There isn’t an alpha parameter, but you can hack this by loading the network as a one mode network (make sure that the node ids do not overlap to avoid self loops).

Best,

Tore

I would like to ask you another question on tnet. Do I understand correctly that degree_tm can be used to calculate degree centrality in a (not weighted) two-mode network and degree_w can be used to calculate degree centrality in a (not two-mode) weighted network?

If I have a weighted two-mode network, would I simply set the network type to type=”weighted two-mode tnet” and then use the degree_w command? This would be great since I could then use the alpha parameter, which isn’t available in degree_tm.

Many thanks and best,

Sebastian ]]>

I started with on longitudinal two-mode networks with Antoine Vernet. Reach out to him as he carried this line for work forward.

Best,

Tore

Hi Tore, thank you for your quick response. I ran the code like this on my data and it did not help. However, I think I now know what went wrong. I have a relatively long list of data frames that correspond to yearly data. I investigated these individually and it turns out that in four years (data frames), there was only one event that took place. I guess this is why R was able to project to an one-mode among primary nodes (actors) but not to an one-mode among secondary nodes (events).

Talking about years… As I understand, tnet can work with either weighted two-mode networks or longitudinal networks. Do you know if there is work going on to analyse longitudinal weighted two-mode networks? On page 3 of the tnet package documentation (https://cran.r-project.org/web/packages/tnet/tnet.pdf), paragraph 3 on timed data seems to go into this direction but I am not whether it is two-mode.

]]>Hi Sebastian,

The first thing to do with weighted two-mode networks is to use the as.tnet-function on them. This is because three column edgelists are assumed to be weighted one-mode networks. Try the code below first, and if you have any issues, send me an email.

Good luck!

Tore

# Load tnet library(tnet) # Create a list object with two of the dataset in tnet nets2m <- list(net1 = read.table("http://opsahl.co.uk/tnet/datasets/OF_two-mode_weightedmsg.txt"), net2 = read.table("http://opsahl.co.uk/tnet/datasets/OF_two-mode_weightedchar.txt")) # Explicitly set network type nets2m <- lapply(nets2m, function(a) as.tnet(net = a, type="weighted two-mode tnet")) # Project to one-mode among primary nodes nets1mP <- lapply(nets2m, function(a) projecting_tm(a, method="sum")) # Project to one-mode among secondary nodes nets2mS <- lapply(nets2m, function(a) a[,c(2,1,3)]) nets1mS <- lapply(nets2mS, function(a) projecting_tm(a, method="sum"))]]>

I have a similar issue. I have a list of data frames that each contain a weighted two-mode network with three columns: “actor”, “event”, “weight”. When I use projecting_tm, it works fine and the command projects the (undirected) weighted two-mode network onto a weighted one-mode network for variable “actor”. I can now compute the closeness_w and betweenness_w.

However, I also want to compute these indicators for the “event”s. This means I have to project the (undirected) weighted two-mode network onto a weighted one-mode network for variable “event”. I have not figured out how to do this within the projecting_tm command, so I simply re-arranged the colums to have a list of data frames that each contain a weighted two-mode network with three columns: “event”, “actor”, “weight”.

When I use projecting_tm, I get the following error messages (similar to @simonegabbriellini’s). I did run the as.tnet, type=”weighted two-mode tnet” commands.

Warning messages:

1: In as.tnet(net1, type = “weighted one-mode tnet”) :

The network might be undirected. If this is the case, each tie should be mention twice. The symmetrise-function can be used to include reverse version of each tie.

2: In min(c(net[, “i”], net[, “j”])) :

no non-missing arguments to min; returning Inf

3: In as.tnet(net1, type = “weighted one-mode tnet”) :

The network might be undirected. If this is the case, each tie should be mention twice. The symmetrise-function can be used to include reverse version of each tie.

4: In min(c(net[, “i”], net[, “j”])) :

no non-missing arguments to min; returning Inf

5: In as.tnet(net1, type = “weighted one-mode tnet”) :

The network might be undirected. If this is the case, each tie should be mention twice. The symmetrise-function can be used to include reverse version of each tie.

6: In min(c(net[, “i”], net[, “j”])) :

no non-missing arguments to min; returning Inf

7: In as.tnet(net1, type = “weighted one-mode tnet”) :

The network might be undirected. If this is the case, each tie should be mention twice. The symmetrise-function can be used to include reverse version of each tie.

8: In min(c(net[, “i”], net[, “j”])) :

no non-missing arguments to min; returning Inf

Hi Simone,

The projecting_tm-function works on two-mode networks. Have you run as.tnet(networkObject, type=’binary two-mode tnet’)?

If you have any issues, email me your code and data. Then I’ll have a look.

Best,

Tore

I am trying to use tnet to work on a two-mode weighted dataset, but I am having troubles to load my data… I read the csv and do as.tnet() without problems, but when I call projecting_tm() I get:

Warning messages:

1: In cbind(p = as.numeric(row.names(np)), np = np) :

si è prodotto un NA per coercizione

2: In Ops.factor(net[, 1], net[, 2]) : not meaningful for factors

4: In as.tnet(net1, type = “weighted one-mode tnet”) :

The network might be undirected. If this is the case, each tie should be mention twice. The symmetrise-function can be used to include reverse version of each tie.

5: In min(c(net[, “i”], net[, “j”])) :

no non-missing arguments to min; returning Inf

Is there any hint you can give me to clear this issue I have?

Best regards,

Simone