| Title: | Easy Analysis and Visualization of Likert Scale Data |
|---|---|
| Description: | Provides functions for summarizing, visualizing, and analyzing Likert-scale survey data. Includes support for computing descriptive statistics, Relative Importance Index (RII), reliability analysis (Cronbach's Alpha), and response distribution plots. |
| Authors: | Mohammad Mollazehi [aut, cre] |
| Maintainer: | Mohammad Mollazehi <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-22 06:09:02 UTC |
| Source: | https://github.com/cran/LikertEZ |
This function calculates the Cronbach Alpha for a set of ordinal items to assess their reliability or internal consistency.
cronbach_alpha(data)cronbach_alpha(data)
data |
A data.frame with the ordinal items. Each column represents an item. |
The Cronbach alpha value as a numeric value between 0 and 1.
This function generates a barplot showing the distribution of responses for a single item, with the Relative Importance Index (RII) annotated.
plot_item(responses, max_scale = 5, scale_labels = NULL)plot_item(responses, max_scale = 5, scale_labels = NULL)
responses |
Numeric vector of ordinal responses. |
max_scale |
Max Likert scale value (default: 5). |
scale_labels |
Optional vector of labels for each scale point. |
A ggplot2 bar plot with RII annotation.
responses <- c(1, 2, 3, 4, 5, 3, 2, 1, NA) plot_item(responses)responses <- c(1, 2, 3, 4, 5, 3, 2, 1, NA) plot_item(responses)
This function ranks items in the data based on either the Relative Importance Index (RII) or the mean of responses.
rank_items(data, method = "rii", max_scale = 5, n = 5, top = TRUE)rank_items(data, method = "rii", max_scale = 5, n = 5, top = TRUE)
data |
A data.frame of ordinal items. |
method |
Method to rank items. Either "rii" (for Relative Importance Index) or "mean" (for mean response). |
max_scale |
Max Likert scale value (default: 5). |
n |
Number of top items to return (default: 5). |
top |
Logical. If TRUE, returns the top items, otherwise returns the bottom items (default: TRUE). |
A vector of ranked items.
This function computes the weighted Relative Importance Index (RII) for a set of ordinal responses with associated weights.
rii_weighted(responses, weights, max_scale = 5)rii_weighted(responses, weights, max_scale = 5)
responses |
Numeric vector of ordinal responses. |
weights |
Numeric vector of weights for each response. |
max_scale |
Max Likert scale value (default: 5). |
The weighted RII as a numeric value.
This function calculates summary statistics for a Likert item, including mean, median, mode, and performs a chi-square test.
summarize(responses, max_scale = 5, exact = TRUE, B = 10000, tidy = FALSE)summarize(responses, max_scale = 5, exact = TRUE, B = 10000, tidy = FALSE)
responses |
Numeric vector of responses. |
max_scale |
The maximum scale value. |
exact |
If TRUE, use exact Monte Carlo method. |
B |
Number of simulations for Monte Carlo. |
tidy |
If TRUE, returns a tidy data frame. |
A list or data.frame with summary statistics.
responses <- c(1, 2, 3, 4, 5, 4, 3, 2, NA) summarize(responses)responses <- c(1, 2, 3, 4, 5, 4, 3, 2, NA) summarize(responses)
This function generates a tidy summary table for all ordinal items in a data.frame. The table includes statistics such as mean, median, standard deviation, counts, and percentages.
summary_table_all(data, max_scale = 5, scale_labels = NULL, decimals = 2)summary_table_all(data, max_scale = 5, scale_labels = NULL, decimals = 2)
data |
A data.frame of ordinal items. |
max_scale |
Max value on the Likert scale (default: 5). |
scale_labels |
Optional vector of labels for each scale point. |
decimals |
Number of decimal places for percentages (default: 2). |
A data.frame with summary statistics for all items.
dat <- data.frame(Q1 = c(1, 2, 3, 4, 5), Q2 = c(2, 2, 3, 4, NA)) summary_table_all(dat)dat <- data.frame(Q1 = c(1, 2, 3, 4, 5), Q2 = c(2, 2, 3, 4, NA)) summary_table_all(dat)