Learn R Programming

smacof (version 2.1-7)

permtest: SMACOF Permutation

Description

These methods perform a permutation test for a symmetric or an unfolding SMACOF model.

Usage

# S3 method for smacof
permtest(object, data,  method.dat = "pearson", nrep = 100, verbose = TRUE, ...)
# S3 method for smacofR
permtest(object, data = NULL,  method.dat = "rows", nrep = 100, verbose = TRUE, ...)
# S3 method for smacofPerm
plot(x, alpha = 0.05, main, xlab, ylab, ...)

Value

stressvec

Vector containing the stress values of the permutation samples

stress.obs

Stress (observed sample)

pval

Resulting p-value

call

Model call

nrep

Number of permutations

nobj

Number of objects

Arguments

object

Object of class "smacofB", i.e., an MDS solution from smacofSym()

data

Optional argument; if provided permutations are performed on the data matrix (see details; ignored for unfolding models)

method.dat

If data are provided, this must be one of "pearson", "spearman", "kendall", "euclidean", "maximum", "manhattan", "canberra", "binary". For unfolding models it is either "full" for full permutations or "rows" for permutations within rows.

nrep

Number of permutations

verbose

If TRUE, permutation index is printed out

x

Object of class "smacofPerm"

alpha

Alpha level

main

Plot title.

xlab

Label of x-axis.

ylab

Label of y-axis.

...

additional plot arguments for plot function; additional arguments to be passed to sim2diss in permutation functions.

Author

Patrick Mair and Ingwer Borg

Details

This routine permutes m dissimilarity values, where m is the number of lower diagonal elements in the corresponding dissimilarity matrix. For each sample a symmetric, nonmetric SMACOF of dimension ndim is computed and the stress values are stored in stressvec. Using the fitted stress value, the p-value is computed. Subsequently, the empirical cumulative distribution function can be plotted using the plot method.

If the MDS fit provided on derived proximities of a data matrix, this matrix can be passed to the permtest function. Consequently, the data matrix is subject to permutations. The proximity measure used for MDS fit has to match the one used for the permutation test. If a correlation similarity is provided, it is converted internally into a dissimilarity using sim2diss with corresponding arguments passed to the ... argument.

References

Mair, P., Borg, I., and Rusch, T. (2016). Goodness-of-fit assessment in multidimensional scaling and unfolding. Multivariate Behavioral Research, 51, 772-789.

Mair, P, Groenen, P. J. F., De Leeuw, J. (2022). More on multidimensional scaling in R: smacof version 2, Journal of Statistical Software, 102(10), 1-47. tools:::Rd_expr_doi("10.18637/jss.v102.i10")

See Also

jackmds, bootmds

Examples

Run this code

## permuting the dissimilarity matrix (full)
data(kinshipdelta)
fitkin <- mds(kinshipdelta, ndim = 2, type = "interval")
set.seed(222)
res.perm <- permtest(fitkin)
res.perm
plot(res.perm)

## permuting the data matrix
GOPdtm[GOPdtm > 1] <- 1     ## use binary version
diss1 <- dist(t(GOPdtm[,1:10]), method = "binary")  ## Jaccard distance
fitgop1 <- mds(diss1, type = "ordinal")
fitgop1
set.seed(123)
permtest(fitgop1, GOPdtm[,1:10], nrep = 10, method.dat = "binary")

rmat <- cor(GOPdtm[,1:10], method = "kendall")  ## Kendall correlation
diss2 <- sim2diss(rmat, method = 1)
fitgop2 <- mds(diss2, type = "ordinal")
fitgop2
set.seed(123)
permtest(fitgop2, GOPdtm[,1:10], nrep = 10, method.dat = "kendall", method = 1)

## unfolding permutation
data(breakfast)
res.unfolding <- unfolding(breakfast, ndim = 2)
set.seed(123)
permtest(res.unfolding, nrep = 20, method.dat = "rows")

Run the code above in your browser using DataLab