Performs Garrett ranking analysis of respondent-ranked items such as
constraints, problems, factors, or priorities. The package converts
respondent rankings into Garrett scores, calculates mean Garrett scores
and final ranks and provides methods for summarizing,tabulating and
visualizing ranking results. It also provides Kendall's coefficient of
concordance for assessing the degree of agreement among respondents.
Garrett ranking does not accommodate tied ranks and Kendall's coefficient
of concordance is likewise computed for untied ranking data.For more details see
Garrett and Woodworth (1969) < https://books.google.com/books?id=aoqSmQEACAAJ> and
Buragohain and Dubey (2021)
GarrettRank provides functions for conducting Garrett ranking analysis. The package is designed to calculate Garrett scores from respondent-level ranking data and provide summarized ranking results in a convenient format.
The package also provides functions for generating tables, summaries, visualizations, and Kendall's coefficient of concordance for assessing agreement among respondents. Visualizations are built using ggplot2 and pheatmap.
The package can be installed using:
install.packages("GarrettRank")
Then load the package:
library(GarrettRank)
The main functions provided by GarrettRank are:
garrett_rank() — performs Garrett ranking analysis.garrett_table() — produces the standard Garrett ranking/percent position conversion table used in the scoring calculation.kendall_w() — calculates Kendall's coefficient of concordance.The package also provides S3 methods for:
summary()plot()The package includes an example dataset called garrett_example.
The dataset contains:
C1 to C22)The dataset can be loaded using:
data("garrett_example")
head(garrett_example)
library(GarrettRank)
data("garrett_example")
# Perform Garrett ranking
result <- garrett_rank(garrett_example, respondent = "Respondent")
# View the result
result
# Summary
summary(result)
# Plot the results
plot(result)
data accepts a data.frame, matrix, CSV file path, or Excel file path. Each row should represent one respondent and each column one factor/constraint, with every respondent assigning each rank from 1 to the number of factors exactly once. respondent specifies the column name or position containing respondent IDs, so it can be excluded before analysis.
plot() supports several type options, covering both item-level ranking summaries and respondent-level agreement patterns:
type |
Description |
|---|---|
| (default) | Default summary plot of Garrett scores by item. |
"bar" |
Bar chart of Garrett scores by item. |
"lollipop" |
Lollipop chart of Garrett scores by item. |
"dot" |
Dot plot of Garrett scores by item. |
"line" |
Line plot of Garrett scores by item. |
"heatmap" |
Ranks × item score heatmap. |
"cluster" |
Hierarchical clustering of respondents by ranking pattern. |
"contribution" |
Contribution of each item to the overall Garrett score. |
Additional arguments for type = "cluster":
k — number of clusters to highlight (e.g., k = 3).scale — scaling applied before clustering (e.g., scale = "row").show_numbers — whether to display values on the cluster heatmap.plot(result, type = "bar")
plot(result, type = "lollipop")
plot(result, type = "dot")
plot(result, type = "line")
plot(result, type = "heatmap")
plot(result, type = "cluster")
plot(result, type = "cluster", k = 3)
plot(result, type = "cluster", scale = "row", show_numbers = TRUE)
plot(result, type = "contribution")
Kendall's coefficient of concordance can be calculated using:
kendall_result <- kendall_w(garrett_example, respondent = "Respondent")
kendall_result
summary(kendall_result)
If you use GarrettRank in your research, please cite the package as:
Varghese, B. B., et al. GarrettRank: Garrett Ranking Analysis in R.
A formal citation will be added once the package is published. Once available, it can be retrieved with:
citation("GarrettRank")
This package is licensed under the GPL-3 license.