dominanceMatrix {dominanceanalysis}R Documentation

Retrieve or calculates a dominance matrix for a given object

Description

This methods calculates or retrieve dominance matrix

This methods allows a common interface to retrieve all dominance matrices from dominanceAnalysis objects

Usage

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,
  ...
)

Arguments

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

Details

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)

Value

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.

See Also

Other retrieval methods: averageContribution(), contributionByLevel(), dominanceBriefing(), getFits()

Examples

# 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")

[Package dominanceanalysis version 2.1.0 Index]