plus_minus {DEXiR} | R Documentation |
Plus-Minus Analysis:
Investigate the effects of changing single attributes values on the evaluation of alternative
.
The values of discrete basic attributes ("input attributes") are changed, one attribute at a time,
by a particular number of steps downwards (minus
) and upwards (plus
),
while observing the changes of the target
attribute values.
plus_minus(
model,
alternative,
target = model$first(),
minus = .Machine$integer.max,
plus = .Machine$integer.max,
print = TRUE,
as_character = FALSE,
round = NULL,
id = NULL,
evaluate = FALSE,
...
)
model |
A DexiModel object. |
alternative |
Either a |
target |
The attribute on which effects are observed. Default: |
minus |
The maximum number of downward steps to be made for each input attribute.
Default: |
plus |
The maximum number of upward steps to be made for each input attribute.
Default: |
print |
|
as_character |
|
round |
An integer number, argument to |
id |
|
evaluate |
|
... |
Optional parameters for |
A data frame consisting of columns:
id
IDs of input attributes (unless excluded by the id
argument).
structure
Structure and names of input attributes (unless excluded by the id
argument).
-minus
to -1
Evaluation value of target
when decreasing the corresponding attribute value by the corresponding number of steps.
target$id
Original alternative
value assigned to the corresponding attribute id
.
1
to plus
Evaluation value of target
when increasing the corresponding attribute value by the corresponding number of steps.
Special values "["
and "]"
denote that it is not possible to decrease of increase, respectively,
the corresponding attributes value further.
# Load "Car.dxi"
CarDxi <- system.file("extdata", "Car.dxi", package = "DEXiR")
Car <- read_dexi(CarDxi)
alt <- Car$alternative("MyCar",
BUY.PRICE="low", MAINT.PRICE="*", X.PERS="more", X.DOORS="4", LUGGAGE=2, SAFETY=c(1, 3))
alte <- Car$evaluate(alt)
# Default plus-minus analysis, evaluating `alt`.
plus_minus(Car, alt, evaluate = TRUE)
# Plus-minus analysis of `alte`, using character strings,
# no pretty-printing and excluding structure info.
plus_minus(Car, alte, as_character=TRUE, print=FALSE, id = "id")
# Plus-minus analysis on `target="PRICE"`, using character strings.
plus_minus(Car, alt, target="PRICE", as_character=TRUE, evaluate=TRUE)