By gluc
AHP lets you analyse complex decision making problems. We have recently released the initial version of the R ahp package on github: gluc/ahp.
What is AHP?
The Analytic Hierarchy Process is a decision making framework developed by Thomas Saaty. Read this entry on Wikipedia for more information.
There is commercial software available to use this methodology for complex decision making problems. In R, there are a few packages that help with the calculation part. However, there has not been a framework to model entire AHP problems. This is the goal of the ahp package.
How to get started
For more information, see the package vignette, either using vignette("car-example")
, or on rpubs. That vignette models the well-known AHP example, which is, for example, explained here.
To install the package and read the vignette, you want to do this:
devtools::install_github("gluc/ahp", build_vignettes = TRUE) vignette("car-example", package = "ahp")
Modeling Analytic Hierarchy Process problems
Once the package is installed, you can run the sample yourself, like so:
library(ahp) ahpFileThis illustrates the basic workflow, which is:
The basic workflow with this package is:
- specify your ahp problem in an ahp file
- load an ahp file, using LoadFile
- calculate model, using Calculate
- output model analysis, either using GetDataFrame or using ShowTable
ahp File Format
The entire ahp problem is specified in a single file, in YAML format. For an example, see here.
Analysis
GetDataFrame
There are two options for the analysis. The first one prints to the console:
GetDataFrame(carAhp)What you will see is something like this:
Weight Odyssey Accord Sedan CR-V Accord Hybrid Element Pilot Consistency
1 Buy Car 100.0% 21.8% 21.6% 16.3% 15.1% 14.7% 10.6% 7.4%
2 ¦--Cost ...read moreSource:: r-bloggers.com