apply.WSM_WPM | R Documentation |
Apply Weighted Sum Model (WSM) or Weighted Product Model (WPM) on data
apply.WSM_WPM(mat, beneficial.vector, weights, method = "WSM")
mat |
is a matrix and contains the values for different properties of different alternatives. |
beneficial.vector |
is a vector that contains the column number of beneficial properties. |
weights |
are the weights of each property in the decision making process |
method |
can either be 'WSM' or 'WPM', set to 'WSM' by default. |
a vector containing the calculated preference score, run rank(-apply.WSM(mat, beneficial.vector, weights)) to get the ranks.
mat <- matrix(c(250, 200, 300, 275,
225, 16, 16, 32,
32, 16, 12, 8,
16, 8, 16, 5,
3, 4, 4, 2), nrow=5, ncol=4)
colnames(mat)<-c("Price", "Storage space",
"Camera", "Looks")
rownames(mat)<-paste0("Mobile ", seq(1, 5, 1))
beneficial.vector <- c(2, 3, 4)
weights <- c(0.25, 0.25, 0.25, 0.25)
apply.WSM_WPM(mat, beneficial.vector, weights, "WSM")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.