Description Usage Arguments Value Examples
View source: R/selectaddavar.R
Selecting and adding a variable to improve PID.
1 2 | selectaddavar(y, x, xh, location, x.given, x.option,
method = "fuzzyAND")
|
y |
A numeric vector of a response variable |
x |
A data frame or a matrix of explanatory variables |
xh |
A data frame or a matrix of discretized explanatory variables |
location |
A data frame of locations |
x.given |
A name of a start variable |
x.option |
A character vector of names of optional variables |
method |
A character of spatial overlay method |
A list of process data of improving PID values by adding a variable.
1 2 3 4 5 6 7 8 9 10 | library(GD)
x <- sim[, 4:6]
x.disc <- apply(x, 2, FUN = function(u) disc(u, 4, "quantile"))
xh <- do.call(cbind, lapply(1:ncol(x), function(u)
data.frame(cut(x[, u], x.disc[[u]]$itv, include.lowest = TRUE))))
names(xh) <- names(x)
sav <- selectaddavar(y = sim[, 1], x = x, xh = xh,
location = sim[, c("lo","la")],
x.given = "xc", x.option = c("xa", "xb"),
method = "fuzzyAND")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.