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:

\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.

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]