groupwise.density {dissUtils} | R Documentation |
In order to compare the distributions of different groups within the same multivariate space, calculates the nearest-neighbor densities of each point in the whole data set according to the distribution of each subset.
groupwise.density(X, groups, method = "euclidean", p.neighbors = 0.01, init.info = NULL)
X |
a matrix of numeric data |
groups |
a factor or vector that can be coerced into a factor, specifying
which group each row of |
method |
see |
p.neighbors |
the proportion of each groups neighbors that should be visited. Proportions are necessary when groups have different sizes because otherwise the densities aren't as comparable. |
init.info |
see |
an nrow(X)
by nlevels(as.factor(groups))
matrix of
nearest-neighbor density estimates.