dist_cent {stressor} | R Documentation |
Distance to Center
Description
Calculates the distance from center of the matrix of predictor variables using a euclidean distance, or the average of all x-dimensions.
Usage
dist_cent(formula, data)
Arguments
formula |
A formula object. |
data |
A data.frame object. |
Details
Formula used to calculate the center point:
Where is a vector of the center of the x-dimensions,
is the number of rows in the matrix, and
is the
entry in the matrix.
Value
A vector of distances from the center.
Examples
data <- data_gen_lm(10)
dist <- dist_cent(Y ~ ., data)
dist
[Package stressor version 0.2.0 Index]