dyadRobust: dyadRobust

dyadRobustR Documentation

dyadRobust

Description

This function calculates dyad-robust standard errors via multiway decomposition, proposed by Aronow, Peter M., Cyrus Samii, and Valentina A. Assenova. "Cluster-robust variance estimation for dyadic data." Political Analysis 23.4 (2015): 564-577 (ARXIV).

Usage

dyadRobust(fit, dat, dyadid, egoid, alterid)

Arguments

fit

The model object. Should be of type 'lm'.

dat

The dataset used to calculate the fit object.

dyadid

Name of column containing the dyad ID. Must be a character.

egoid

Name of column containing the ego ID. Must be a character.

alterid

Name of column containing the alter ID. Must be a character.

Value

Returns a list containing the following components:

bhat

A named vector of coefficient estimates from the fit model object.

sehat

A named vector of dyad-robust standard errors calculated via multiway decomposition.

Examples

data("dyad.sim")
m <- lm(dY ~ dX,dyad.sim)
out <- dyadRobust(fit = m,
           dat = dyad.sim,
           dyadid = "dyads",
           egoid = "dyad1",
           alterid = "dyad2")

jbisbee1/dyadRobust documentation built on Aug. 6, 2024, 11:21 a.m.