Learn R Programming

dominanceanalysis (version 2.0.0)

dominanceMatrix: 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 data.frame dominanceMatrix(x, undefined.value = 0.5, ordered = FALSE, ...)

# S3 method for matrix dominanceMatrix(x, undefined.value = 0.5, ordered = FALSE, ...)

# S3 method for 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

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.

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)

See Also

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

Examples

Run this code
# NOT RUN {
# 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")
# }

Run the code above in your browser using DataLab