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

View source: R/select_egoalter.R

select_egoalterR Documentation

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)

## S3 method for class 'diffnet_adoptChanges'
summary(object, ...)

Arguments

graph

A dynamic graph (see netdiffuseR-graphs).

adopt

n\times 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.

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
Yes 7 8 15 16

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).

Value

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

time

Integer represting the time period

id

Node id

select_a_01, ..., select_a_16

Number of new links classified between categories 1 to 16.

select_d_01, ..., select_d_16

Number of remove links classified between categories 1 to 16.

select_s_01, ..., select_s_16

Number of unchanged links classified between categories 1 to 16.

Author(s)

George G. Vega Yon & Thomas W. Valente

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 \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.socscimed.2015.10.001")}

Examples

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

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

srdyal/diffusiontest documentation built on Dec. 9, 2024, 1:14 a.m.