Description Usage Arguments Details Value See Also Examples
View source: R/dominanceMatrix.r
This methods calculates or retrieve dominance matrix
This methods allows a common interface to retrieve all dominance matrices from dominanceAnalysis objects
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | dominanceMatrix(x, ...)
## S3 method for class 'data.frame'
dominanceMatrix(x, undefined.value = 0.5, ordered = FALSE, ...)
## S3 method for class 'matrix'
dominanceMatrix(x, undefined.value = 0.5, ordered = FALSE, ...)
## S3 method for class 'dominanceAnalysis'
dominanceMatrix(
x,
type,
fit.functions = NULL,
drop = TRUE,
ordered = FALSE,
...
)
|
x |
matrix (calculate) or dominanceAnalysis (retrieve) |
... |
extra arguments. Not used |
undefined.value |
value when no dominance can be established |
ordered |
Logical. If TRUE, sort the output according to dominance. |
type |
type of dominance matrix to retrieve. Could be complete, conditional or general |
fit.functions |
name of the fit indices to retrieve. If NULL, all fit indices will be retrieved |
drop |
if TRUE and just one fit index is available, returns a matrix. Else, returns a list |
To calculate a dominance matrix from a matrix or dataframe, use
dominanceMatrix(x,undefined.value)
.
To retrieve the dominance matrices from a dominanceAnalysis object, use
dominanceMatrix(x,type,fit.function,drop)
for matrix and data-frame, returns a matrix representing dominance.
1 represents domination of the row variable over the column variable,
0 dominance of the column over the row variable.
Undefined dominance is represented by undefined.value
parameter.
For dominanceAnalysis object, returns a matrix, if drop
parameter
if TRUE and just one index is available. Else, a list is returned, with
keys as name of fit-indices and values as matrices, as described previously.
Other retrieval methods:
averageContribution()
,
contributionByLevel()
,
dominanceBriefing()
,
getFits()
1 2 3 4 5 6 7 | # For matrix or data.frame
mm<-data.frame(a=c(5,3,2),b=c(4,2,1),c=c(5,4,3))
dominanceMatrix(mm)
# For dominanceAnalysis
data(longley)
da.longley<-dominanceAnalysis(lm(Employed~.,longley))
dominanceMatrix(da.longley,type="complete")
|
a b c
a 0.5 1.0 0.5
b 0.0 0.5 0.0
c 0.5 1.0 0.5
GNP.deflator GNP Unemployed Armed.Forces Population Year
GNP.deflator 0.5 0.5 0.5 0.5 0.5 0.5
GNP 0.5 0.5 0.5 0.5 1.0 0.5
Unemployed 0.5 0.5 0.5 0.5 0.5 0.5
Armed.Forces 0.5 0.5 0.5 0.5 0.5 0.5
Population 0.5 0.0 0.5 0.5 0.5 0.5
Year 0.5 0.5 0.5 0.5 0.5 0.5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.