Learn R Programming

SNscan (version 1.0)

norm.stat: Normal Scan Statistic

Description

The normal scan statistic evaluates the statistic which compares the node attribute within the subgraph with that outside the subgraph while the node attribute follows the normal distribution.

Usage

norm.stat(obs, pop = 1, zloc)

Arguments

obs
Numeric vector of observation values.
pop
Numeric vector of population values ; default = 1.
zloc
Numeric vector of selected nodes.

Value

  • Three values will be returned. The first value is test statistic. The second is the estimated means which estimated outside the selected nodes. The third is the estimated means estimated within the selected nodes.

Details

A network with interested attributes is denoted as $G=(V,E,X)$, where $X=(x_1,\ldots,x_{|V|})$ follows a defined distribution. Suppose a subgraph, $Z$, is selected. $$\lambda_A(Z)=n\ln (\sqrt{(\hat{\sigma}^2))}-n\ln (\sqrt{(2 \hat{\sigma}_z^2)}),$$ where $\hat{\sigma}^2=\sum_{i=1}^n(x_i-\bar{x})^2/n$, and $\hat{\sigma}_z^2=[\sum_{i \in Z}(x_i-\bar{x}_z)^2-\sum_{j \notin Z}(x_j-\bar{x}_x)^2]/n$, in which $n$ is the number of nodes, and $\bar{x}_z=\sum_{i \in Z} x_i/n_z$ and $\bar{x}_c=\sum_{j \notin Z} x_j/(n-n_z)$. It is equivalent to minimize the variance within the subgraph $Z$.

References

Kulldorff, M., Huang, L., & Konty, K. (2009). A scan statistic for continuous data based on the normal probability model. International journal of health geographics, 8(1), 58.

Examples

Run this code
norm.stat(obs=rnorm(100,10,1),zloc=1:5)

Run the code above in your browser using DataLab