cepp.weights: Compute region weights for 'cepp.test'

View source: R/cepp.weights.R

cepp.weightsR Documentation

Compute region weights for cepp.test

Description

Compute region weights for cepp.test

Usage

cepp.weights(nn, pop, nstar)

Arguments

nn

A list of nearest neighbors produced by casewin.

pop

The population size associated with each region.

nstar

The size of the at-risk population in each window.

Value

A list with elements related to the weight each nearest neighbor region will have in the corresponding weighted sum used to compute the test statistic

Examples

data(nydf)
coords <- with(nydf, cbind(x, y))
pop <- nydf$pop
# intercentroid distances
d <- gedist(coords)
# find smallest windows with cumulative population of
# at least n* = 1000
nn <- casewin(d, pop, 1000)
# compute weights
w <- cepp.weights(nn, pop, 1000)

jpfrench81/smerc documentation built on Jan. 13, 2024, 4:30 a.m.