smacof (version 1.8-13)

permtest: SMACOF Permutation

Description

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

Usage

"permtest"(object, data, method.dat = "pearson", nrep = 100, verbose = TRUE, ...) "permtest"(object, data = NULL, method.dat = "full", nrep = 100, verbose = TRUE, ...) "plot"(x, alpha = 0.05, main, xlab, ylab, ...)

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.

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

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.

See Also

jackknife.smacofB

Examples

Run this code

## permuting the dissimilarity matrix (full)
data(kinshipdelta)
fitkin <- mds(kinshipdelta, ndim = 1, type = "interval")
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
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
permtest(fitgop2, GOPdtm[,1:10], nrep = 10, method.dat = "kendall", method = 1)

## unfolding
data(breakfast)
res.unfolding <- unfolding(breakfast, itmax = 5000, ndim = 2)
res.perm <- permtest(res.unfolding, nrep = 10, method.dat = "rows")
res.perm
plot(res.perm)

Run the code above in your browser using DataLab