permtest.smacof: SMACOF Permutation

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/permtest.smacof.R

Description

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

Usage

1
2
3
4
5
6
## S3 method for class 'smacof'
permtest(object, data,  method.dat = "pearson", nrep = 100, verbose = TRUE, ...)
## S3 method for class 'smacofR'
permtest(object, data = NULL,  method.dat = "rows", nrep = 100, verbose = TRUE, ...)
## S3 method for class 'smacofPerm'
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.

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.

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

Author(s)

Patrick Mair and Ingwer Borg

See Also

jackmds, bootmds

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## 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")

smacof documentation built on Feb. 11, 2021, 3 a.m.