| Title: | Profile Analysis via Multidimensional Scaling |
|---|---|
| Description: | Implements Profile Analysis via Multidimensional Scaling (PAMS) for the identification of population-level core response profiles from cross-sectional and longitudinal person-score data. Each person profile is decomposed into a level component (the person mean) and a pattern component (ipsatized subscores). PAMS uses nonmetric multidimensional scaling via the SMACOF algorithm (de Leeuw & Mair, 2009) to identify a small number of core profiles that represent the central response patterns in a sample of any size. Bootstrap standard errors and bias-corrected and accelerated (BCa) confidence intervals for individual core profile coordinates are estimated, enabling significance testing of coordinates that is not available in other profile analysis methods such as cluster profile analysis or latent profile analysis. Person-level weights, R-squared values, and correlations with core profiles are also estimated, allowing individual profiles to be interpreted in terms of the core profile structure. PAMS can be applied to both cross-sectional data and longitudinal data, where core trajectory profiles describe how response patterns change over time. |
| Authors: | Se-Kang Kim [aut, cre] (ORCID: <https://orcid.org/0000-0002-2460-3415>), Donghoh Kim [aut] (ORCID: <https://orcid.org/0000-0002-3946-0777>) |
| Maintainer: | Se-Kang Kim <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-31 09:24:54 UTC |
| Source: | https://github.com/sekangakim/pams |
Identifies population-level core response profiles from cross-sectional or
longitudinal person-score data using nonmetric multidimensional scaling
(SMACOF algorithm). Each person profile is decomposed into a level
component (person mean) and a pattern component (ipsatized subscores).
BootSmacof fits a nonmetric MDS solution to the
inter-variable distance matrix, bootstraps the solution to generate
empirical sampling distributions of core profile coordinates, and computes
bias-corrected and accelerated (BCa) confidence intervals for each
coordinate. Person-level weights, R-squared values, and correlations with
core profiles are estimated for all participants, with optional bootstrap
confidence intervals for a selected subset.
BootSmacof( testdata, participant = NULL, mds = c("smacof", "classical"), type = c("ratio", "interval", "ordinal", "mspline"), distance = c("euclid", "sqeuclid"), scale = FALSE, nprofile = 3, direction = rep(1, nprofile), cl = 0.95, nBoot = 2000, testname = NULL, file = NULL )BootSmacof( testdata, participant = NULL, mds = c("smacof", "classical"), type = c("ratio", "interval", "ordinal", "mspline"), distance = c("euclid", "sqeuclid"), scale = FALSE, nprofile = 3, direction = rep(1, nprofile), cl = 0.95, nBoot = 2000, testname = NULL, file = NULL )
testdata |
A data frame or matrix of persons (rows) by subscales (columns). Subscores are assumed to be related and continuous. For longitudinal data, columns should be ordered as all subscales at Time 1 followed by all subscales at Time 2, and so on. |
participant |
An integer vector of row indices identifying persons for
whom individual bootstrap confidence intervals on weights and partial
correlations are computed. If |
mds |
Character string specifying the MDS algorithm. Either
|
type |
Character string specifying the optimal scaling transformation
passed to |
distance |
Character string specifying the distance measure used to
compute the |
scale |
Logical. If |
nprofile |
A positive integer specifying the number of core profiles
(MDS dimensions) to extract. Choose by inspecting stress values across
2-, 3-, and 4-dimensional solutions; Kruskal's (1964) criterion of
stress |
direction |
An integer vector of length |
cl |
Numeric confidence level for BCa intervals. Default is
|
nBoot |
A positive integer specifying the number of bootstrap
samples. A minimum of |
testname |
An optional character vector of length equal to the number
of columns in |
file |
An optional character string giving a file path stem. If
supplied, three CSV files are written: |
A named list with the following components:
MDSThe MDS fit object for the original data. When
mds = "smacof" this is the full object returned by
smacofSym, including $conf (core
profile coordinate matrix, ) and $stress.
When mds = "classical" this is a minimal list with
$conf only.
MDSsummaryA list of nprofile data frames, one
per core profile. Each data frame has rows corresponding to
subscales and columns: Ori (original coordinate),
Mean (bootstrap mean), SE (bootstrap standard error),
Lower and Upper (percentile CI bounds),
BCaLower and BCaUpper (BCa CI bounds). Coordinates
whose BCa CI does not include zero are statistically significant.
MDSprofileA list of nprofile matrices, each of
dimension nBoot , containing the full
bootstrap distribution of core profile coordinates.
stresssummaryA one-row data frame with bootstrap
summary statistics for the smacof stress value: Ori,
Mean, SE, Lower, Upper,
BCaLower, BCaUpper. NULL when
mds = "classical".
stressprofileA numeric vector of length nBoot
containing bootstrap stress values. NULL when
mds = "classical".
MDSR2A numeric vector of length nprofile
containing the R-squared values from regressing each core profile
dimension on the remaining dimensions. Low values confirm that the
core profiles are not collinear.
WeightA matrix of dimension
containing, for every person: raw weights (w1, ...,
wK), level estimate, R-squared value, and correlations with
each core profile (corDim1, ..., corDimK).
Row names are "#1", "#2", ...
WeightmeanR2The mean R-squared value across all
persons, summarising how well the nprofile core
profiles account for pattern variance in the sample.
WeightBA matrix of bootstrap summary statistics
(original estimate, mean, SE, lower and upper CI bounds) for the
weights of each person in participant. NULL if
participant is NULL.
PcorrBA matrix of bootstrap summary statistics for
the partial correlations of each person in participant.
NULL if participant is NULL.
nprofileThe number of core profiles extracted.
nBootThe number of bootstrap samples used.
scaleLogical; whether columns were standardised.
testnameCharacter vector of subscale names used.
Davison, M. L. (1996). Multidimensional scaling interest and aptitude profiles: Idiographic dimensions, nomothetic factors. Presidential address to Division 5, American Psychological Association, Toronto.
de Leeuw, J., & Mair, P. (2009). Multidimensional scaling using majorization: SMACOF in R. Journal of Statistical Software, 31(3), 1–30. doi:10.18637/jss.v031.i03
Efron, B., & Tibshirani, R. J. (1993). An introduction to the bootstrap. Chapman & Hall.
Kim, S.-K., & Kim, D. (2024). Utility of profile analysis via multidimensional scaling in R for the study of person response profiles in cross-sectional and longitudinal data. The Quantitative Methods for Psychology, 20(3), 230–247. doi:10.20982/tqmp.20.3.p230
Kruskal, J. B. (1964). Multidimensional scaling by optimizing goodness of fit to a nonmetric hypothesis. Psychometrika, 29, 1–27. doi:10.1007/BF02289565
smacofSym for the underlying MDS
algorithm.
## Not run: # Cross-sectional example using bundled WJ-IV cognitive ability data. library(pams) library(smacof) cross_data <- read.csv( system.file("extdata", "Cross-sectional.csv", package = "pams"), header = FALSE ) colnames(cross_data) <- c( "OV1","NS2","VA3","LP4","PP5","SR6","VS7","GI8", "CF9","NR10","NP11","NW12","VA13","PR14","AS15", "ON16","PC17","MW18" ) # Inspect stress across dimensionalities to choose nprofile smacofSym(dist(t(cross_data)), ndim = 2, type = "ordinal")$stress smacofSym(dist(t(cross_data)), ndim = 3, type = "ordinal")$stress smacofSym(dist(t(cross_data)), ndim = 4, type = "ordinal")$stress # Run PAMS with 3 core profiles and 2,000 bootstrap samples set.seed(1) result <- BootSmacof( testdata = cross_data, participant = 1:10, mds = "smacof", type = "ordinal", distance = "euclid", nprofile = 3, direction = c(-1, 1, 1), cl = 0.95, nBoot = 2000, testname = colnames(cross_data) ) result$MDS$stress # should be <= 0.05 result$WeightmeanR2 # mean R^2 across all persons # Core profile coordinates with BCa CIs round(result$MDSsummary[[1]], 3) round(result$MDSsummary[[2]], 3) round(result$MDSsummary[[3]], 3) # Weights and correlations for first 10 persons round(result$Weight[1:10, ], 2) ## End(Not run)## Not run: # Cross-sectional example using bundled WJ-IV cognitive ability data. library(pams) library(smacof) cross_data <- read.csv( system.file("extdata", "Cross-sectional.csv", package = "pams"), header = FALSE ) colnames(cross_data) <- c( "OV1","NS2","VA3","LP4","PP5","SR6","VS7","GI8", "CF9","NR10","NP11","NW12","VA13","PR14","AS15", "ON16","PC17","MW18" ) # Inspect stress across dimensionalities to choose nprofile smacofSym(dist(t(cross_data)), ndim = 2, type = "ordinal")$stress smacofSym(dist(t(cross_data)), ndim = 3, type = "ordinal")$stress smacofSym(dist(t(cross_data)), ndim = 4, type = "ordinal")$stress # Run PAMS with 3 core profiles and 2,000 bootstrap samples set.seed(1) result <- BootSmacof( testdata = cross_data, participant = 1:10, mds = "smacof", type = "ordinal", distance = "euclid", nprofile = 3, direction = c(-1, 1, 1), cl = 0.95, nBoot = 2000, testname = colnames(cross_data) ) result$MDS$stress # should be <= 0.05 result$WeightmeanR2 # mean R^2 across all persons # Core profile coordinates with BCa CIs round(result$MDSsummary[[1]], 3) round(result$MDSsummary[[2]], 3) round(result$MDSsummary[[3]], 3) # Weights and correlations for first 10 persons round(result$Weight[1:10, ], 2) ## End(Not run)