dissmfacw(formula, data, R = 1000, gower = FALSE, squared = FALSE,
weights = NULL)
dissmfac(formula, data, R = 1000, gower = FALSE, squared = TRUE,
permutation = "dissmatrix")
dist
object.formula
should be taken.dissmultifactor
object with the following components:boot
objectdissassoc
to account for several explanatory variables.
The function computes the part of discrepancy explained by the list of covariates specified in the formula
.
It provides for each covariate the Type-II effect, i.e. the effect measured when removing the covariate from the full model with all variables included.
(The returned F values may slightly differ from those obtained with TraMineR versions older than 1.8-9. Since 1.8-9, the within sum of squares at the denominator is divided by $n-m$ instead of $n-m-1$, where $n$ is the sample size and $m$ the total number of predictors and/or contrasts used to represent categorical factors.)
For a single factor dissmfac
is slower than dissassoc
.
Moreover, the latter performs also tests for homogeneity in within-group discrepancies (equality of variances) with a generalization of Levene's and Bartlett's statistics.
Part of the function is based on the Multivariate Matrix Regression with qr decomposition algorithm written in SciPy-Python by Ondrej Libiger and Matt Zapala (See Zapala and Schork, 2006, for a full reference.) The algorithm has been adapted for Type-II effects and extended to account for case weights.dissvar
to compute a pseudo variance from dissimilarities and for a basic introduction to concepts of discrepancy analysis.
dissassoc
to test association between objects represented by their dissimilarities and a covariate.
disstree
for an induction tree analysis of objects characterized by a dissimilarity matrix.
disscenter
to compute the distance of each object to its group center from pairwise dissimilarities.## Define the state sequence object
data(mvad)
mvad.seq <- seqdef(mvad[, 17:86])
## Compute dissimilarities (any dissimilarity measure can be used)
mvad.ham <- seqdist(mvad.seq, method="HAM")
## And now the multi-factor analysis
print(dissmfac(mvad.ham ~ male + Grammar + funemp +
gcse5eq + fmpr + livboth, data=mvad, R=10))
Run the code above in your browser using DataLab