 # An R script to calculate the Kano Model

The procedure I described in https://marcellodelbono.it/en/2019/06/14/prioritizing-the-product-backlog-with-the-kano-model/ is a bit intricate so I wrote a script to make the calculation with R, starting from the survey outcome file. Here it is. In order to give you an idea on how to implement it yourself,  it starts with reading an excel file with the survey outcome, then it classifies every intersection of Functional/Dysfunctional answer into the Kano categories.

``````# like=1, expect=2, neutral=3, live with = 4, dislike 5
# Assigning each functional/dysfunctional combination to a category
feature_A<-feature_A %>%
mutate(category = case_when(
Functional =="1" & Dysfunctional == "1" ~ "Questionable",
Functional =="1" &  Dysfunctional >"1" &  Dysfunctional <"5" ~ "Delighters", Functional =="1" & Dysfunctional =="5" ~ "Desired", Functional >"1" & Functional <"5" & Dysfunctional == "1" ~ "Reverse", Functional >"1" & Functional <"5" & Dysfunctional >"1" &  Dysfunctional <"5" ~ "Indifferent", Functional >"1" & Functional <"5" & Dysfunctional =="5" ~ "Required",
Functional =="5" & Dysfunctional <"5" ~ "Reverse",
Functional =="5" & Dysfunctional =="5" ~ "Questionable"
))``````

The script goes on counting each Functional/Dysfunctional intersection, classifies them into categories and then groups by categories, summing up again.  Then, it plots out the output matrix, with a heatmap style. Here’s the plotting code with  ggplot:

``````final_prod_cat %>%
ggplot( aes( Dysfunctional, Functional))+
geom_tile(aes(fill=total_count), colour="black") +