Home

listw

Listw is a class in the R package spdep that represents a spatial weights list. It is a data structure used to encode the strength and pattern of spatial relationships among observations, typically derived from a defined neighborhood structure.

A listw object stores weights as a list, with one numeric vector per observation. Each vector contains

Listw objects are typically created from a neighbor list using functions such as nb2listw, or from a

In practice, listw objects interact with related structures in spdep, including nb (neighbor lists) and mat

the
weights
assigned
to
that
observation’s
neighbors,
in
the
order
of
the
corresponding
neighbor
list
(nb).
The
object
also
carries
metadata,
including
the
original
neighbor
structure
and
a
weighting
style
that
determines
how
the
weights
are
normalized
or
scaled.
Common
style
options
include
row-standardized
weights
(weight
rows
so
sums
equal
one),
binary
weights
(0/1
without
normalization),
and
unstandardized
weights
(weights
kept
as
provided).
The
handling
of
observations
with
no
neighbors
can
be
controlled
via
a
policy
parameter,
often
referred
to
as
zero.policy.
weight
matrix
using
appropriate
converters.
They
are
central
to
many
spatial
analyses,
because
they
define
how
nearby
observations
influence
each
other
in
computations.
They
are
used
to
compute
spatially
lagged
variables
(via
lag.listw),
perform
spatial
autocorrelation
tests
(such
as
Moran’s
I),
and
support
various
spatial
regression
and
diagnostic
procedures.
or
other
representations
of
weights.
They
can
be
inspected,
subsetted,
and
passed
to
analysis
functions,
with
methods
designed
to
respect
the
underlying
neighbor
relationships
and
the
chosen
weighting
style.
This
makes
listw
a
foundational
component
for
modeling
and
testing
spatial
processes
in
R.