Description Usage Arguments Details Value Examples
The function generates a scatter plot of item rank (y-axis) versus importance (x-axis)
1 2 3 4 5 6 7 | ggimportance(
x,
dep_var = "general",
title = "",
xlabel = "Relative contribution to dependent variable",
ylabel = "Mean rank (1-5)"
)
|
x |
a tbl() with the data. |
dep_var |
The name of the dependent variable (use dplyr style without quotes) Usually this would be either general satisfaction or NPS |
title |
string for ggtitle |
xlabel |
string for xlab |
ylabel |
string for ylab |
The function uses the 'relaimpo' package to compute item importance (relative to a dependent variable) Then, it plots the item's rank versus computed importance. To compute importance the function uses the 'lmg' measure (see documentation of 'relaimpo::calc.relimp') A linear model (function 'lm') is used for the importance computation. if the model have perfect fit or a bad fit, the function output would be based only on the model coefficients and not on 'relaimpo::calc.relimp'
A ggplot2 as specified above.
1 2 3 4 5 6 7 8 9 | satisfaction <- tribble(
~general, ~staff, ~professionalism,
5, 5, 4,
3, 2, 3,
4, 5, 5,
1, 2, 2,
3, 3, 4
)
ggimportance(satisfaction, dep_var = general)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.