[statnet_help] ergm.ego with ego-ego ties
Michał Bojanowski
michal2992 at gmail.com
Tue May 9 02:51:02 PDT 2023
Dear Mathieu,
There are a couple of issues here:
1. Whether ergm.ego is an appropriate inference approach depends on
how you selected the artists (the "egos") and what is your target of
inference. In other words, how are you willing to define the
"population network" in the framework of egocentric ERGMs
2. From a purely technical perspective, for ergm.ego you need to
construct an egor object using the 'egor' package. There is more than
one way of doing that, please have a look at the documentation.
3. The implementation of ergm.ego essentially ignores the fact if two
ego-alter ties are in fact the same tie in the population (i.e the two
ego-networks overlap). If it happens only rarely and can be ignored
vis a vis the sample size and population size, you should be good to
go. If, on the other hand, it is a feature of the way you selected the
egos (for example by a procedure resembling a snowball sample) then
ergm.ego will not be appropriate.
hope this helps
Michal
On Mon, May 8, 2023 at 11:28 AM Mathieu Janssen
<m.h.a.p.janssen at tilburguniversity.edu> wrote:
>
> 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
>
> _______________________________________________
> statnet_help mailing list
> statnet_help at u.washington.edu
> http://mailman13.u.washington.edu/mailman/listinfo/statnet_help
More information about the statnet_help
mailing list