Skip to content

Commit

Permalink
fix #120 by moving listw2U to nb2listw page
Browse files Browse the repository at this point in the history
  • Loading branch information
rsbivand committed Jan 27, 2023
1 parent a3ad610 commit 65e56ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

* fix #121 and #123; correcting returned values for `localG_perm()` when estimating the G-star measure (fix self x values and weights)

* address #120, moving documentation of `listw2U()` from `?lm.morantest` to `?nb2listw`

* addressing #119 for interpretation of `moran_bv()` results

* adding #116, René Westerholt
Expand Down
5 changes: 1 addition & 4 deletions man/lm.morantest.Rd
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
% Copyright 2001-5 by Roger S. Bivand
\name{lm.morantest}
\alias{lm.morantest}
\alias{listw2U}
\title{Moran's I test for residual spatial autocorrelation}
\description{
Moran's I test for spatial autocorrelation in residuals from an estimated linear model (\code{lm()}). The helper function \code{listw2U()} constructs a weights list object corresponding to the sparse matrix \eqn{\frac{1}{2} ( \mathbf{W} + \mathbf{W}'}{1/2 (W + W')}
}
Moran's I test for spatial autocorrelation in residuals from an estimated linear model (\code{lm()}). }
\usage{
lm.morantest(model, listw, zero.policy=NULL, alternative = "greater",
spChk=NULL, resfun=weighted.residuals, naSubset=TRUE)
listw2U(listw)
}
\arguments{
\item{model}{an object of class \code{lm} returned by \code{lm}; weights
Expand Down
5 changes: 4 additions & 1 deletion man/nb2listw.Rd
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
% Copyright 2001-2014 by Roger S. Bivand
\name{nb2listw}
\alias{nb2listw}
\alias{listw2U}
\title{Spatial weights for neighbours lists}
\description{
The \code{nb2listw} function supplements a neighbours list with spatial weights for the chosen coding scheme. The \code{can.be.simmed} helper function checks whether a spatial weights object is similar to symmetric and can be so transformed to yield real eigenvalues or for Cholesky decomposition.
The \code{nb2listw} function supplements a neighbours list with spatial weights for the chosen coding scheme. The \code{can.be.simmed} helper function checks whether a spatial weights object is similar to symmetric and can be so transformed to yield real eigenvalues or for Cholesky decomposition. The helper function \code{listw2U()} constructs a weights list object corresponding to the sparse matrix \eqn{\frac{1}{2} ( \mathbf{W} + \mathbf{W}'}{1/2 (W + W')}.
}
\usage{
nb2listw(neighbours, glist=NULL, style="W", zero.policy=NULL)
listw2U(listw)
}
\arguments{
\item{neighbours}{an object of class \code{nb}}
\item{glist}{list of general weights corresponding to neighbours}
\item{style}{\code{style} can take values \dQuote{W}, \dQuote{B}, \dQuote{C}, \dQuote{U}, \dQuote{minmax} and \dQuote{S}}
\item{zero.policy}{default NULL, use global option value; if FALSE stop with error for any empty neighbour sets, if TRUE permit the weights list to be formed with zero-length weights vectors}
\item{listw}{a \code{listw} object created for example by \code{nb2listw}}
}
\details{
Starting from a binary neighbours list, in which regions are either listed as neighbours or are absent (thus not in the set of neighbours for some definition), the function adds a weights list with values given by the coding scheme style chosen. B is the basic binary coding, W is row standardised (sums over all links to n), C is globally standardised (sums over all links to n), U is equal to C divided by the number of neighbours (sums over all links to unity), while S is the variance-stabilizing coding scheme proposed by Tiefelsdorf et al. 1999, p. 167-168 (sums over all links to n).
Expand Down

0 comments on commit 65e56ac

Please sign in to comment.