dyadic_wy: Adds a new Wy column which measures specific/aggregate...

View source: R/spatial_lag.R

dyadic_wyR Documentation

Adds a new Wy column which measures specific/aggregate origin/destination contagion (directed dyadic cross-sectional or panel data)

Description

Adds a new Wy column which measures specific/aggregate origin/destination contagion (directed dyadic cross-sectional or panel data)

Usage

dyadic_wy(
  dat,
  origin = "unit1",
  destination = "unit2",
  y = "y",
  w = "w",
  wy = "wy",
  time = NULL,
  type = "specific_origin",
  weights = "ik",
  row_normalize = TRUE,
  zero_loop = TRUE,
  progress = FALSE
)

Arguments

dat

directed dyadic dataset (data.frame)

origin

name of origin id column (character)

destination

name of destination id column (character)

y

name of outcome to lag (character)

w

name of distance/weights column (character)

wy

name of the output variable (character)

time

name of the time variable (optional) (character)

type

of W matrix (character)

  • specific origin: y_ij = f(sum_k!=i w * y_kj)

  • specific destination: y_ij = f(sum_m!=j w * y_im)

  • aggregate origin: y_ij = f(sum_k!=i sum_m w * y_km)

  • aggregate destination: y_ij = f(sum_k sum_m!=j w * y_km)

weights

weight specification: ik, jk, im, jm (character)

row_normalize

should each value of the W matrix be divided by the row-wise sum? (boolean)

zero_loop

should wy be set to 0 when origin == destination (boolean)

progress

boolean show progress bar (boolean). Only works with 'plan(multiprocess)' and panel data ('time != NULL').


vincentarelbundock/btergmHelper documentation built on Aug. 24, 2023, 11:17 a.m.