[statnet_help] ergm.ego with ego-ego ties

Mathieu Janssen m.h.a.p.janssen at tilburguniversity.edu
Mon May 8 02:27:19 PDT 2023


Dear statnetters,



My name is Mathieu, and I am a data science master's student at Tilburg
University. For a research project I'm doing, I have constructed a network
with Spotify data that focuses on artists' collaborations.

I have two harvests of data. 1) specific artists and their collaborators,
2) info on all the artists and their collaborators. The data structure is
ego nets.

I have a few questions about the *ergm.ego *package. Thanks in advance to
anyone that will spend a few minutes to help me out.



My edge list looks like that:



edgelist <- data.frame(c("ego1", "ego2", "ego3","ego4","ego5","ego5"),
c("alter1", "alter2", "alter3", "alter2", "ego2", "alter1"))



In plain English, I do not have alter-alter ties, but I do have ego-ego
ties.



Question 1: is ergm.ego the right package for that? If not, can you
recommend a different one that would allow me to run ERGMs on this data
structure? Or would you please suggest how to constrain a regular ERGM?



If ergm.ego is the right one, is this the right way to import the data?



library(ergm.ego)

temp_n <- network::as.network.data.frame(edgelist, directed = FALSE)

temp_n <- network::set.vertex.attribute(temp_n, "is_emerging", value =
c(TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE))

temp_n.ego <- as.egor(temp_n, ego_name = c("is_emerging"))



Using the as.egor() function, the result is not what I expect. Exactly
those nodes with is_emerging == True should be egos, the rest alters. When
the as.egor() function is called, some of the alters are included as egos,
which is not desired. Therefore, I adjust the underlying Tibbles myself.



old_egos <- as.data.frame(temp_n.ego$ego)

new_egos <- old_egos[old_egos$is_emerging == TRUE,]

new_egos <- as_tibble(new_egos)



old_alters <- as.data.frame(temp_n.ego$alter)

new_alters <- old_alters[old_alters$.egoID %in% new_egos$.egoID,]

new_alters <- as_tibble(new_alters)



artists.ego <- egor(egos = new_egos, new_alters, ID.vars = list(ego =
".egoID", alter = ".altID"))



Question 2: is this the correct way to import this data type? As you can
see, we have no data on the Alter-Alter ties, so they are left out of the
final function call.



Many thanks,



Mathieu Janssen

Jheronimus Academy of Data Science / Tilburg University

A: JADS, Sint Janssingel 92, 5211 DA 's-Hertogenbosch, The Netherlands

E: Mathieu-janssen at live.nl / m.h.a.p.janssen at tilburguniversity.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman13.u.washington.edu/pipermail/statnet_help/attachments/20230508/47fe20d0/attachment.html>


More information about the statnet_help mailing list