ahpsurvey (version 0.4.0)

ahp.mat: Generate AHP pairwise matrices from survey data

Description

ahp.mat takes in paired comparisons from survey data with questions using the analytic hierarchy process and converts it into pairwise comparison matrices for each individual decision-maker. Examples based on Saaty2004;textualahpsurvey.

Usage

ahp.mat(df, atts, negconvert = FALSE, reciprocal = TRUE)

Arguments

df

a dataframe, each row corresponding to one decision-maker, with columns ordered according to atts.

atts

a list of attributes in the correct order

negconvert

logical, whether to convert all positive values to negative. In the pairwise comparison A_B, if -6 denotes A is more important than B by 6 units, set negconvert = TRUE.

reciprocal

logical, whether to convert negative values (after negconvert) to its reciprocal. If the comparison A_B where B is more important than A was already entered in its reciprocal (e.g. 1/6), choose reciprocal = FALSE. When reciprocal = FALSE, do not set negconvert = TRUE.

Value

A list of pairwise comparison matrices of each decision-maker.

References

Saaty2004ahpsurvey

Examples

Run this code
# NOT RUN {

data(city200)
atts <- c('cult', 'fam', 'house', 'jobs', 'trans')
ahp.mat(df = city200, atts = atts, negconvert = TRUE)

# }

Run the code above in your browser using DataCamp Workspace