step2factors: Performs Factor Analysis to Select a Subset of the 24...

View source: R/step2factors.R

step2factorsR Documentation

Performs Factor Analysis to Select a Subset of the 24 Measures

Description

Performs a factor analysis to reduce the set of 24 measures into a smaller set of measures that captures the main features of the trajectories.

Usage

step2factors(
  trajMeasures,
  num.factors = NULL,
  discard = NULL,
  verbose = TRUE,
  ...
)

Arguments

trajMeasures

List generated by step1mesures. Contains original data, original time and 24 measures.

num.factors

Numerical value specifying the number of factors to choose. Defaults to NULL. See details.Defaults to NULL.

discard

Vector containing names or numerical positions of measures to discard during factor analysis.

verbose

Logical indicating if the function should print information on screen. Defaults to TRUE.

...

Arguments to be passed to principal. See details.

Details

If num.factor is NULL,the function will select the number of factors as the number of eigenvalues greater than 1.

The principal function is used in order to choose the measure that will represent each factor. varimax is used to rotate the data during the execution of the\ codeprincipal function. Any other parameter can be passed through ... in order to further control the principal function.

If any measures that happen to be extremely correlated among themselves (corr. >= 0.95), one of them will have to be removed. Such measures are flagged by step1measures. These values can be removed with discard or they will be automatically removed by the function.

Value

trajFactors Object containing the measures chosen as factors, the eigenvalues of the correlation matrix of the 24 measures, the list generated by the principal function used for the factor analysis and the data stored in the trajMeasures object.

Author(s)

Marie-Pierre Sylvestre, Dan Vatnik

marie-pierre.sylvestre@umontreal.ca

See Also

principal step1measures

Examples

## Not run: 
# Setup data 
data = example.data$data

# Run step1measures and step2factors
s1 = step1measures(data, ID=TRUE)
s2 = step2factors(s1)

# Display factors
head(s2$factors)

# The next step would be to run "step3clusters"

## End(Not run)



traj documentation built on April 14, 2023, 12:39 a.m.