View source: R/functions_stats.R
gen_tstat | R Documentation |
Generate default test statistics given a network structure.
gen_tstat(G, type)
G |
The N\times N adjacency matrix where N is the number of units. |
type |
The statistics to use. Currently support |
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}.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.