Learn R Programming

freqweights (version 1.0.4)

pcafreq: Principal Component Analysis

Description

It computes a principal component analysis with sumplementary quantitative and qualitative variables. It is wrapper of PCA.

Usage

pcafreq(data, freq = NULL, scale.unit = TRUE, ncp = 5, quantisup = NULL,
  qualisup = NULL, colw = NULL, graph = TRUE, axes = c(1, 2))

.pcafreq(tfq, scale.unit = TRUE, ncp = 5, quantisup = NULL, qualisup = NULL, colw = NULL, graph = TRUE, axes = c(1, 2))

Arguments

data
a data frame
freq
a name of the variable specifying frequency weights
scale.unit
a boolean, if TRUE (value set by default) then data are scaled to unit variance
ncp
number of dimensions kept in the results
quantisup
a vector indicating the names of the quantitative supplementary variables
qualisup
a vector indicating the names of the categorical supplementary variables
colw
an optional column weights (by default, uniform column weights)
graph
boolean, if TRUE a graph is displayed
axes
a length 2 vector specifying the components to plot
tfq
a table of frequencies

Value

It returns a list described in PCA.

Details

This function calls PCA with the the frequency weights as row.w. Any variable present in freq are removed from the data.

See Also

PCA, link{tablefreq}

Examples

Run this code
pcafreq(iris,  qualisup="Species", graph=TRUE)

tfq <- tablefreq(iris)
.pcafreq(tfq,  qualisup="Species", graph=TRUE)

Run the code above in your browser using DataLab