ahp {ahpsurvey} | R Documentation |
Canned routine for AHP
Description
ahp
is a canned routine that returns a data.frame
of individuals' priorities (based on ahp.indpref), number of missing values, consistency ratios, and top three pairs of inconsistent pairwise comparisons. An optional argument agg
allows the user to generate a data.frame of aggregated priorities alongside individual priorities.
Usage
ahp(
df,
atts,
negconvert = FALSE,
reciprocal = TRUE,
method = "eigen",
aggmethod = "geometric",
qt = 0,
censorcr = Inf,
agg = FALSE,
ID = NULL,
col = NULL,
suppress = "none"
)
Arguments
df |
a dataframe, each row corresponding to one decision-maker, with columns ordered according to |
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 |
reciprocal |
logical, whether to convert negative values (after |
method |
if |
aggmethod |
how to aggregate the individual priorities. By default |
qt |
specifies the quantile which the top and bottom priority weights are trimmed. Used only if |
censorcr |
the threshold of censoring observations. All observations with a consistency ratio higher than the specified CR will be dropped from the routine. By default, |
agg |
by default, |
ID |
the column name, or a vector of column names, of variables in |
col |
a list of column names which contains the columns for the pairwise comparison matrix in chronological order, as specified in |
suppress |
Suppresses the supplementary indices. Can take the values of "all" (suppresses all indices), "pwerror" (suppresses pwerror), or "cr" (suppresses consistency ratio). |
Value
If agg = TRUE
, returns a list of the results with two elements, indpref
and aggpref
. $indpref
contains individual preference weight (same as ahp.indpref
), consistency ratios, and the top three most inconsistent pairwise comparisons (same as ahp.pwerror
). $aggpref
contains the Aggregated Priorities and Standard Deviations. Otherwise (i.e. default setting), outputs a data.frame
with only $indpref
.
Author(s)
Frankie Cho
References
Saaty TL (2004). “Decision making — the Analytic Hierarchy and Network Processes (AHP/ANP).” Journal of Systems Science and Systems Engineering, 13(1), 1–35. ISSN 1861-9576, doi: 10.1007/s11518-006-0151-5, https://doi.org/10.1007/s11518-006-0151-5.
Examples
data(city200)
ahp(df = city200, atts = c('cult', 'fam', 'house', 'jobs', 'trans'), negconvert = TRUE)