dt.tools {bpca} | R Documentation |
Data Tools for Multivariate
Description
Calculates vector variable lengths, angles between vector variables and variable correlations from ‘data.frame’ or ‘matrix’ objects
Usage
dt.tools(x,
center=2,
scale=TRUE)
Arguments
x |
A |
center |
Numeric.
The type of centering to be performed: |
scale |
Logical.
A value indicating whether the variables should be scaled to have unit
variance before the analysis takes place: |
Details
This function computes: vector variable lengths, angles between vector
variables and variable correlations from data.frame
or matrix
objects.
If the data are centered (center=2
), the correlations are the
same as those obtained by the cor
function.
Value
An list
with the components:
length |
A vector of the lengths. |
angle |
A matrix of the angles. |
r |
A matrix of the observed correlations. |
Author(s)
Faria, J. C.
Allaman, I. B.
Demétrio C. G. B.
References
Johnson, R. A. and Wichern, D. W. (1988) Applied multivariate statistical analysis. Prentice-Hall, Inc., Upper Saddle River, NJ, USA, 6 ed.
See Also
Examples
##
## Computes: vector variable lengths, angles between vector variables and
## variable correlations from data.frame or matrix objects (n x p)
## n = rows (objects)
## p = columns (variables)
##
dt <- dt.tools(iris,
2) # No numeric columns are removed in dt.tools
# Exploring the object 'bp' created by the function 'var.tools'
class(dt)
names(dt)
str(dt)
dt$length
dt$angle
dt$r
dt
# Checking the determinations
(iris.tools <- round(dt.tools(iris,
center=2)$r,
5))
(iris.obsv <- round(cor(iris[-5]),
5))
all(iris.tools == iris.obsv)