This function applies the following dimension reduction algorithm
to the measures computed by Step1Measures
:
Drop the measures whose values are constant across the trajectories;
Whenever two measures are highly correlated (absolute value of Pearson correlation > 0.98), keep the highest-ranking measure on the list (see Step1Measures
) and drop the other;
Use principal component analysis (PCA) on the measures to form factors summarizing the variability in the measures;
Drop the factors whose variance is smaller than any one of the standardized measures;
Perform a varimax rotation on the remaining factors;
For each rotated factor, select the measure that has the highest correlation (aka factor loading) with it and that hasn't yet been selected;
Drop the remaining measures.
Step2Selection(trajMeasures, num.select = NULL, discard = NULL, select = NULL)# S3 method for trajSelection
print(x, ...)
# S3 method for trajSelection
summary(object, ...)
An object of class trajSelection
; a list containing the values
of the selected measures, the output of the principal component analysis as
well as a curated form of the arguments.
object of class trajMeasures
as returned by
Step1Measures
.
an optional positive integer indicating the number of
factors to keep in the second stage of the algorithm. Defaults to NULL
so
that all factors with variance greater than any one of the normalized
measures are selected.
an optional vector of positive integers corresponding to the
measures to be dropped from the analysis. See
Step1Measures
for the list of measures. Defaults to
NULL
.
an optional vector of positive integers corresponding to the
measures to forcefully select. Defaults to NULL
. If a vector is supplied,
the five-steps selection algorithm described above is bypassed and the
corresponding measures are selected instead.
object of class trajSelection
.
further arguments passed to or from other methods.
object of class trajSelection
.
Whenever two measures are highly correlated (Pearson correlation >
0.98), the highest-ranking measure on the list (see Step1Measures
) is kept and the other is discarded and discards the others. PCA is applied on the remaining measures using the principal
function from the psych
package.
Leffondre K, Abrahamowicz M, Regeasse A, Hawker GA, Badley EM, McCusker J, Belzile E. Statistical measures were proposed for identifying longitudinal patterns of change in quantitative health indicators. J Clin Epidemiol. 2004 Oct;57(10):1049-62. doi: 10.1016/j.jclinepi.2004.02.012. PMID: 15528056.
principal
Step1Measures
if (FALSE) {
data("trajdata")
trajdata.noGrp <- trajdata[, -which(colnames(trajdata) == "Group")] #remove the Group column
m = Step1Measures(trajdata.noGrp, measure = c(1:18), ID = TRUE)
s = Step2Selection(m)
print(s)
s2 = Step2Selection(m, select = c(13, 3, 12, 9))
}
Run the code above in your browser using DataLab