gen_tstat: Generate test statistics

View source: R/functions_stats.R

gen_tstatR Documentation

Generate test statistics

Description

Generate default test statistics given a network structure.

Usage

gen_tstat(G, type)

Arguments

G

The N\times N adjacency matrix where N is the number of units. G[i,j] equals 1 iff there is an edge between units i and j in the network, and we set all diagonal entries of G to be 0.

type

The statistics to use. Currently support "elc","score","htn" in Athey et al. (2018) Exact p-Values for Network Interference section 5.

Details

In the following G is the adjacency matrix and F is the vector of focal indicator.

  • "elc" is the edge-level-contrast test statistic, which equals \frac{∑_{i,j\neq i} F_i G_{ij} (1-F_j) Z_j Y_i^{obs}}{∑_{i,j\neq i} F_i G_{ij} (1-F_j) Z_j} - \frac{∑_{i,j\neq i} F_i G_{ij} (1-F_j) (1-Z_j) Y_i^{obs}}{∑_{i,j\neq i} F_i G_{ij} (1-F_j) (1-Z_j) }

  • "score" is a score statistic, which equals \mathrm{cov}≤ft( Y_i^{obs}-\hat{α}-\hat{τ}_{d} Z_i,~ ∑_{j=1}^N Z_j \bar{G}_{ij} \bigg| ∑_{j=1}^N G_{ij} >0, F_i=1 \right).

  • "htn" is the has-treated-neighbor statistic, which equals \frac{1}{\mathrm{sd}_{Y_F^{obs}}\mathrm{sd}_{\mathrm{indicator}_F} } \frac{1}{N_F} ∑_{i:F_i=1} (Y_i^{obs}-\bar{Y}_F^{obs})1\{∑_j G_{ij} Z_j (1-F_j) >0 \} where N_F is the number of focal units, \cdot_F means restricting a variable to focal units only, and \bar{Y}_F^{obs} is the sample average of Y_F^{obs}.


dpuelz/CliqueRT documentation built on Jan. 6, 2023, 11:20 p.m.