Learn R Programming

netdiffuseR (version 1.17.0)

select_egoalter: Calculate the number of adoption changes between ego and alter.

Description

This function calculates the 16 possible configurations between ego and alter over two time points in terms of their behavior and tie changes. From time one to time two, given a binary state of behavior, ego and alter can be related in 16 different ways. The function adopt_changes is just an alias for select_egoalter.

Usage

select_egoalter(graph, adopt, period = NULL)
adopt_changes(graph, adopt, period = NULL)
"summary"(object, ...)

Arguments

graph
A dynamic graph (see netdiffuseR-graphs).
adopt
$n*T$ matrix. Cumulative adoption matrix obtained from toa_mat.
period
Integer scalar. Optional to make the count for a particular period of time.
object
An object of class diffnet_adoptChanges.
...
Ignored.

Value

An object of class diffnet_adoptChanges and data.frame with $n * (T-1)$ rows and $2 + 16 * 3$ columns. The column names are: columns. The column names are:

Details

The 16 possibilities are summarized in this matrix:

Alter
$t-1$ No
Yes $t-1$ $t$ No
Yes No Yes Ego No No
1 2 9 10
Yes 3 4 11 12
Yes No 5 6 13 14

The first two Yes/No columns represent Ego's adoption of the innovation in $t-1$ and $t$; while the first two Yes/No rows represent Alter's adoption of the innovation in $t-1$ and t respectively. So for example, number 4 means that while neither of the two had addopted the innovation in $t-1$, both have in $t$. At the same time, number 12 means that ego adopted the innovation in $t$, but alter had already adopted in $t-1$ (so it has it in both, $t$ and $t-1$).

References

Thomas W. Valente, Stephanie R. Dyal, Kar-Hai Chu, Heather Wipfli, Kayo Fujimoto, Diffusion of innovations theory applied to global tobacco control treaty ratification, Social Science & Medicine, Volume 145, November 2015, Pages 89-97, ISSN 0277-9536 (http://dx.doi.org/10.1016/j.socscimed.2015.10.001)

Examples

Run this code
# Simple example ------------------------------------------------------------
set.seed(1312)
dn <- rdiffnet(20, 5, seed.graph="small-world")

ans <- adopt_changes(dn)
str(ans)
summary(ans)

Run the code above in your browser using DataLab