| Title: | Garrett Ranking Analysis and Visualization |
|---|---|
| Description: | 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) <doi:10.5958/2454-552X.2021.00055.4>. |
| Authors: | Blesson B. Varghese [aut, cre], Adarsh V S [aut], Bhavana Sajeev [aut], Azhanuo Rutsa [aut], Joe Shiney M A [aut] |
| Maintainer: | Blesson B. Varghese <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.5 |
| Built: | 2026-10-07 09:35:51 UTC |
| Source: | https://github.com/cran/GarrettRank |
#Example Dataset for Garrett Ranking
garrett_examplegarrett_example
A data frame with 50 rows and 23 columns:
The name or serial number identifying each respondent.
Rank assigned to constraint 1.
Rank assigned to constraint 2.
Rank assigned to constraint 3.
Rank assigned to constraint 4.
Rank assigned to constraint 5.
Rank assigned to constraint 6.
Rank assigned to constraint 7.
Rank assigned to constraint 8.
Rank assigned to constraint 9.
Rank assigned to constraint 10.
Rank assigned to constraint 11.
Rank assigned to constraint 12.
Rank assigned to constraint 13.
Rank assigned to constraint 14.
Rank assigned to constraint 15.
Rank assigned to constraint 16.
Rank assigned to constraint 17.
Rank assigned to constraint 18.
Rank assigned to constraint 19.
Rank assigned to constraint 20.
Rank assigned to constraint 21.
Rank assigned to constraint 22.
The first column contains the respondent's name or serial number. The remaining 22 columns (C1 to C22) contain the ranks assigned by each respondent to the corresponding constraints. There are 50 respondents in the dataset. No tied ranks are present in the dataset.
The dataset contains ranking responses from 50 respondents for 22 constraints.
data(garrett_example) #Run Garrett ranking analysis result <- garrett_rank(garrett_example,respondent = "Respondent") summary(result) result$ranking result$frequency result$weighted_scores #Select the plot type 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="contribution") plot(result, type = "cluster", k = 3) plot(result,type = "cluster",scale = "row",show_numbers = TRUE) #Run Kendall's Coefficient of Concordance kw<-kendall_w(garrett_example,respondent = "Respondent") summary(kw)data(garrett_example) #Run Garrett ranking analysis result <- garrett_rank(garrett_example,respondent = "Respondent") summary(result) result$ranking result$frequency result$weighted_scores #Select the plot type 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="contribution") plot(result, type = "cluster", k = 3) plot(result,type = "cluster",scale = "row",show_numbers = TRUE) #Run Kendall's Coefficient of Concordance kw<-kendall_w(garrett_example,respondent = "Respondent") summary(kw)
Performs Garrett ranking analysis on respondent ranking data.
garrett_rank(data, respondent = NULL)garrett_rank(data, respondent = NULL)
data |
A data.frame, matrix, CSV file path or Excel file path containing ranking data. |
respondent |
Optional respondent ID column name or column position to exclude before analysis. |
Each row must represent one respondent and each column one factor, constraint, or item. Each respondent must assign every rank from 1 to the number of factors exactly once.
An object of class "garrett", which is a list containing:
A data.frame containing the factor names, mean Garrett
scores, and final ranks. Mean_Score is the average Garrett score
for each factor across all respondents. Higher mean Garrett scores
indicate higher overall priority, and Rank = 1 represents the
highest-ranked factor.
A data.frame containing the number of respondents assigning each possible rank to each factor, together with the corresponding percent positions and Garrett scores.
A numeric matrix containing the rank frequencies multiplied by their corresponding Garrett scores. These values are used to calculate the mean Garrett score for each factor.
A data.frame containing the standard Garrett conversion table used to convert percent positions into Garrett scores.
An integer giving the number of respondents included in the analysis.
An integer giving the number of factors ranked by the respondents.
A character vector containing the names of the ranked factors.
The matched function call used to create the object.
result <- garrett_rank(garrett_example,respondent = "Respondent") summary(result) result$ranking result$frequency result$weighted_scoresresult <- garrett_rank(garrett_example,respondent = "Respondent") summary(result) result$ranking result$frequency result$weighted_scores
Garrett Conversion Table It is a standard Garrett conversion table used by the package.
garrett_table()garrett_table()
A data.frame with two columns:
The percent position values used to determine Garrett scores from respondent ranks.
The corresponding Garrett scores assigned to the percent positions.
table<-garrett_table() print(table)table<-garrett_table() print(table)
Computes Kendall's coefficient of concordance (W) for complete, untied ranking data.
kendall_w(data, respondent = NULL)kendall_w(data, respondent = NULL)
data |
A data.frame, matrix, CSV file path, or Excel file path containing ranking data. |
respondent |
Optional respondent ID column name or column position to exclude before analysis. |
Each row must represent one respondent and each column one factor. Each respondent must assign every rank from 1 to the number of factors exactly once. Tied ranks are not supported.
An object of class "kendall_w", which is a list containing:
Kendall's coefficient of concordance (W), ranging from 0 to 1, where larger values indicate stronger agreement among respondents.
The chi-square statistic used to test the statistical significance of the concordance.
Degrees of freedom for the chi-square test.
The p-value associated with the chi-square test.
The number of respondents included in the analysis.
The number of ranked factors.
A named numeric vector containing the sum of ranks assigned to each factor across respondents.
The matched function call.
data(garrett_example) kw <- kendall_w(garrett_example,respondent = "Respondent") kw summary(kw)data(garrett_example) kw <- kendall_w(garrett_example,respondent = "Respondent") kw summary(kw)
Produces graphical representations of Garrett ranking results.
## S3 method for class 'garrett' plot( x, type = c("bar", "lollipop", "dot", "line", "heatmap", "cluster", "contribution"), top = NULL, color = "#2C7FB8", label = TRUE, point_size = 3, line_size = 1, cluster_rows = TRUE, cluster_cols = FALSE, distance = "euclidean", clustering_method = "complete", scale = "none", show_numbers = FALSE, ... )## S3 method for class 'garrett' plot( x, type = c("bar", "lollipop", "dot", "line", "heatmap", "cluster", "contribution"), top = NULL, color = "#2C7FB8", label = TRUE, point_size = 3, line_size = 1, cluster_rows = TRUE, cluster_cols = FALSE, distance = "euclidean", clustering_method = "complete", scale = "none", show_numbers = FALSE, ... )
x |
An object of class |
type |
Type of plot. Options are |
top |
Number of top-ranked factors to display. Default is |
color |
Colour used for ranking plots. |
label |
Logical. Should Garrett scores be displayed as labels? |
point_size |
Size of points used in dot, lollipop, and line plots. |
line_size |
Width of lines used in lollipop and line plots. |
cluster_rows |
Logical. Should factors be hierarchically clustered in cluster plots? |
cluster_cols |
Logical. Should ranks be hierarchically clustered? |
distance |
Distance measure used for hierarchical clustering. |
clustering_method |
Method used for hierarchical clustering. |
scale |
Should heatmap data be scaled by rows, columns, or not
scaled? Options are |
show_numbers |
Logical. Should matrix values be displayed inside heatmap cells? |
... |
Additional arguments passed to |
For "bar", "lollipop", "dot", and
"line" plots, a ggplot object. For "heatmap",
"cluster", and "contribution" plots, a pheatmap
object returned invisibly. The returned object contains the graphical
representation of the Garrett ranking results.
data(garrett_example) result <- garrett_rank(garrett_example,respondent = "Respondent") #Select the plot type 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="contribution") plot(result, type = "cluster", k = 3) plot(result,type = "cluster",scale = "row",show_numbers = TRUE)data(garrett_example) result <- garrett_rank(garrett_example,respondent = "Respondent") #Select the plot type 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="contribution") plot(result, type = "cluster", k = 3) plot(result,type = "cluster",scale = "row",show_numbers = TRUE)