dist_cent | R Documentation |
Calculates the distance from center of the matrix of predictor variables using a euclidean distance, or the average of all x-dimensions.
dist_cent(formula, data)
formula |
A formula object. |
data |
A data.frame object. |
Formula used to calculate the center point:
\bar{x} = \frac{1}{N}\sum_{j = 1}^N x_{ij}
Where \bar{x}
is a vector of the center of the x-dimensions,
N
is the number of rows in the matrix, and x_{ij}
is the
i,j^{th}
entry in the matrix.
A vector of distances from the center.
data <- data_gen_lm(10)
dist <- dist_cent(Y ~ ., data)
dist
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.