Learn R Programming

EloRating (version 0.46.11)

dyadic_reversals: changes in dyadic relationships

Description

compare dyadic relationships before and after a certain date

Usage

dyadic_reversals(eloobject, cutpoint = NULL, daterange = NULL)

Value

a data.frame with one line per dyad:

id1,id2

the dyad

pre_n,post_n

the number of interactions for that dyad pre and post cutpoint date

pre,post

which of the two was dominant (1 = id1, 2 = id2, 0 = tied relationship, NA = unknown relationship, i.e. 0 interactions)

Arguments

eloobject

result from elo.seq

cutpoint

character or Date, the date at which to split into pre and post (default is NULL, where the data is split in halves). The actual date here will be included in the 'pre' period.

daterange

character or Date of length 2, the date range to be considered (default is NULL where the entire date range in the data is used)

Examples

Run this code
data(adv)
eloobject <- elo.seq(winner = adv$winner, loser = adv$loser, Date = adv$Date)
# split at halfway point ("2010-01-17")
# one reversal: a-f
dyadic_reversals(eloobject)
# shift split date so that both interactions for a/f occur in the post period,
# which makes it a tie in post and unknown in pre
dyadic_reversals(eloobject, cutpoint = "2010-01-10")

Run the code above in your browser using DataLab