View source: R/incrementalLID.R
incrementalLID | R Documentation |
Determine the bandwidth that maximizes the non-group component of inequality.
incrementalLID(
x,
dist,
bws = Inf,
def.neigh = 0,
offset = function(x) 2 * x,
n = rep(1, length(x)),
ntrials = 50,
alpha = 0.05,
standard = NULL,
expect = NULL,
mode = "adaptive",
weighting = "membership",
FUN = NULL,
inf.val = NULL,
row.stand = "fuzzy",
minval = 50,
var.stand = FALSE,
var.exp = FALSE,
ng.invert = TRUE,
max.cross = .Machine$integer.max,
pb = TRUE,
...
)
x |
A vector of weights with the same length as |
dist |
A matrix or distance object representing pairwise distances. The distances need not be symmetrical. |
bws |
A vector containing the representing the bandwidth within neighbors
are considered. If |
def.neigh |
Numeric. At what distance (in the map units) are observations definitely neighbors?
All distances are subtracted by this value, and all resulting distances less than zero are reassigned
to |
offset |
What value is added to the denominator to prevent singularities from arising
(e.g. whenever the value is 1/0)? Larger values imply smaller distance-decay. This should be
a numeric of length one or |
n |
A vector representing population weights. How much of an impact does a given
observation have on any other observation regardless of its influence as provided
for in |
ntrials |
The number of permutations to perform. Default is 50. |
alpha |
Threshold for significance. Default is |
standard |
The standards matrix with dimensions |
expect |
The expectations matrix with dimensions |
mode |
One of |
weighting |
One of |
FUN |
The distance function. Default is |
inf.val |
When singularities arise, (i.e. whenever the value is 1/0), by what value are
they replaced? Default is the |
row.stand |
Logical or |
minval |
When distances are raw, what is the minimum allowable distance?
Default is |
var.stand |
Logical. Should the standards be permuted if a matrix was
provided? Default is |
var.exp |
Logical. Should the expectations be permuted if a matrix was
provided? Default is |
ng.invert |
Does a higher non-group value imply higher between group inequality?
Default is |
max.cross |
When processing, what is the maximum number of rows that
an internal data.table can have? This is generally not a concern unless
the number of observations approaches |
pb |
Logical. Should a progress bar be displayed? Default is |
... |
Additional parameters to pass on to |
A list with three entries:
(1) index
A named character with the code of the index named by its name
(2) $bws
The bandwidths that significantly optimize the non-group inequality.
Generally, a neighborhood is the first significant peak.
(3) $stats
A data.table with the global group, non-group, and total values
for each bandwidth, as well as a column indicating whether or not it's significant.
# Generate dummy observations
x <- runif(10, 1, 100)
# Get distance matrix
dists <- dist(x, upper = TRUE, diag = TRUE)
# Bandwidth sizes from 3 to 5
bws <- 3:6
inc <- incrementalLID(x, dist = dists, bws = bws, index = 'gini', type = 'local',
weighting = 'distance', FUN = function(x) 1/x^2, minval = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.