losh: Local spatial heteroscedacity

View source: R/losh.R

loshR Documentation

Local spatial heteroscedacity

Description

Local spatial heteroscedacity

Usage

losh(x, nb, wt, a = 2, ...)

losh_perm(x, nb, wt, a = 2, nsim = 499, ...)

Arguments

x

a numeric vector.

nb

a neighbor list for example created by st_contiguity()

wt

a weights list for example created by st_weights()

a

the exponent applied to the local residuals

...

methods passed to spdep::LOSH

nsim

number of simulations to run

Value

a data.frame with columns

  • hi: the observed statistic

  • e_hi: the sample average

  • var_hi: the sample variance

  • z_hi the approximately Chi-square distributed test statistic

  • x_bar_i: the local spatially weight mean for observation i

  • ei: residuals

Examples

nb <- st_contiguity(guerry)
wt <- st_weights(nb)
x <- guerry$crime_pers
losh(x, nb, wt)
losh(x, nb, wt, var_hi = FALSE)
losh_perm(x, nb, wt, nsim = 49)

sfdep documentation built on Sept. 13, 2024, 5:07 p.m.