Skip to contents

The factor detector q-statistic measures the spatial stratified heterogeneity of a variable Y, or the determinant power of a covariate X of Y.

Usage

factor_detector(y, x)

Arguments

y

Variable Y, continuous numeric vector.

x

Covariate X, factor, character or discrete numeric.

Value

A list.

Q-statistic

the q statistic for factor detector

P-value

the p value for factor detector

Author

Wenbo Lv lyu.geosocial@gmail.com

Examples

factor_detector(y = 1:7,x = c('x',rep('y',3),rep('z',3)))
#> $`Q-statistic`
#> [1] 0.7714286
#> 
#> $`P-value`
#> [1] 0.07936477
#>