ssh.test: Evaluate stratification

View source: R/ssh.test.r

ssh.testR Documentation

Evaluate stratification

Description

Calculate the factor detector q-statistic and the interaction detector in the geographical detector model described by Wang et al. (2010). The q-statistic measures the SSH of the sampling attribute in terms of a given stratification, which can be used for the selection of an SSH layer for Sandwich model-based mapping. The interactive effects indicate whether a combination of two stratifications enhances the SSH of the sampling attribute.

Usage

ssh.test(object,
       y,
       x,
       test="factor",
       type="shp")

Arguments

object

An object generated by ssh.data.shp or ssh.data.txt.

y

Text for the name of the explained variable (sampling attribute) in object.

x

Text for the name(s) of the explanatory variable(s) (stratification(s)) in object.

test

Text for the type of test. test="factor" denotes the factor detector, and test="interaction" denotes the interaction detector. By default, test="factor".

type

Text for the type of input data. type="shp" denotes shapefiles, and type="txt" denotes text files. By default, type="shp".

Value

A value of the q-statistic or the combined q-statistic.

References

Wang, J. F., Li, X. H., Christakos, G., Liao, Y. L., Zhang, T., Gu, X., & Zheng, X. Y. (2010). Geographical detectors-based health risk assessment and its application in the neural tube defects study of the Heshun Region, China. International Journal of Geographical Information Science, 24(1), 107-127.

See Also

ssh.data.shp, ssh.data.txt

Examples

library(sf)
library(tools)
data(sim.data)
sim.join <- ssh.data.shp(object=sim.data[[1]], ssh.lyr=sim.data[[2]], ssh.id="X")
head(sim.join)
ssh.test(object=sim.join, y="Value", x=c("X"), test="factor")


sandwichr documentation built on April 27, 2023, 1:10 a.m.