Description Usage Arguments Value Examples
Power of spatial determinant (PSD).
1 | qs(y, xh, location)
|
y |
A numeric vector of a response variable |
xh |
A character variable, a data frame or a matrix of explanatory variables |
location |
A matrix of spatial locations |
A power of spatial determinant (PSD) value.
1 2 3 4 5 6 7 8 9 10 11 12 | # an explanatory variable
library(GD)
data.disc <- disc(sim$xa, 4, "quantile")
xh <- cut(sim$xa, data.disc$itv, include.lowest = TRUE)
qs(sim$y, xh, location = sim[, c("lo","la")])
# multiple explanatory variables
data <- sim[,4:6]
data.disc <- apply(data, 2, FUN = function(x) disc(x, 4, "quantile"))
xh <- do.call(cbind, lapply(1:ncol(data), function(x)
data.frame(cut(data[, x], data.disc[[x]]$itv, include.lowest = TRUE))))
names(xh) <- names(data)
qs(sim$y, xh, location = sim[, c("lo","la")])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.