The Relative Importance Index (RII) is calculated using the following formula:

\[ RII = \frac{{\sum (W_i \times X_i)}}{{(k \times n)}} \]

Where:

In the formula, \(\sum (W_i \times X_i)\) represents the sum of the product of the weights and frequencies for each level of the Likert scale.

# load library for import of excel data 
library(readxl)

demo_data

The data is retrieved from a section of a questionnaire based on students failure rate (FR) in Mathematics. It is used in RII analysis for a demonstration.

# Import data
data <- read_excel("demo_data.xlsx")
names(data)
[1] "FR1" "FR2" "FR3" "FR4" "FR5" "FR6" "FR7" "FR8"
# Create a data frame with only the Likert scale columns
likert_data <- data[, c("FR1", "FR2", "FR3", "FR4", "FR5", "FR6", "FR7", "FR8")]
head(likert_data)
# A tibble: 6 × 8
    FR1   FR2   FR3   FR4   FR5   FR6   FR7   FR8
  <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1     3     2     5     2     3     4     4     2
2     3     4     3     5     3     4     3     2
3     2     1     3     3     2     1     3     3
4     5     5     5     5     5     4     5     5
5     5     4     3     2     2     4     2     4
6     5     5     5     4     4     1     4     3
# Define the Likert scale weights
weights <- c(1, 2, 3, 4, 5)
responses <- c("Strongly disagree", "Disagree", "Neutral", "Agree", "Strongly agree")
likert_W <- data.frame(weights, responses)
likert_W
  weights         responses
1       1 Strongly disagree
2       2          Disagree
3       3           Neutral
4       4             Agree
5       5    Strongly agree
# Calculate mean for each item
mean_values <- colMeans(likert_data)
data.frame(mean_values)
    mean_values
FR1    3.791469
FR2    3.767773
FR3    3.322275
FR4    3.473934
FR5    2.995261
FR6    2.729858
FR7    2.848341
FR8    3.336493
# Calculate sum of the product of the weights and frequencies for each level of the Likert scale
TotalF <- colSums(likert_data * weights)
data.frame(TotalF)
    TotalF
FR1   2399
FR2   2404
FR3   2106
FR4   2178
FR5   1912
FR6   1750
FR7   1829
FR8   2088
TotalW <- sum(weights) * nrow(likert_data) 
data.frame(TotalW)
  TotalW
1   3165
# Calculate RII for each item (column)
rii_values <- TotalF / TotalW
# Calculate ranks for RII values
rii_ranks <- rank(-rii_values)

# Combine RII, mean, and ranks into a data frame
result_data <- data.frame(Item = names(rii_values), Mean = mean_values, TotalF = TotalF, TotalW = TotalW, RII = rii_values, Rank = rii_ranks)
# View the resulting data frame
rownames(result_data) <- NULL    # removes the row names
knitr::kable(result_data, digits=4, caption = "Relative importance index for FR")
Relative importance index for FR
Item Mean TotalF TotalW RII Rank
FR1 3.7915 2399 3165 0.7580 2
FR2 3.7678 2404 3165 0.7596 1
FR3 3.3223 2106 3165 0.6654 4
FR4 3.4739 2178 3165 0.6882 3
FR5 2.9953 1912 3165 0.6041 6
FR6 2.7299 1750 3165 0.5529 8
FR7 2.8483 1829 3165 0.5779 7
FR8 3.3365 2088 3165 0.6597 5

Where,

FR1 - Mathematics is difficult

FR2 - My teacher is not friendly

FR3 - We cannot ask questions in the class

FR4 - I don’t think I can pass Mathematics

FR5 - The workings sometimes look like magic

FR6 - My parents discouraged me

FR7 - My elder brother and sister also find it difficult

FR8 - I hate Mathematics

# load necessary libraries
library(ggplot2)
Warning: package 'ggplot2' was built under R version 4.3.2
# Create a data frame with RII values and factor names
data <- data.frame(
  Factor = c("FR1", "FR2", "FR3", "FR4", "FR5", "FR6", "FR7", "FR8"),
  RII = c(0.7580, 0.7596, 0.6654, 0.6882, 0.6041, 0.5529, 0.5779, 0.6597)
)

# Create a radar chart
ggplot(data, aes(x = Factor, y = RII)) +
  geom_polygon(fill = "lightblue", color = "blue", size = 1) +
  geom_point(color = "red", size = 3) +
  theme_minimal() +
  coord_polar() +
  labs(title = "Radar Chart of RII Analysis for Failure Rate in Mathematics",
       subtitle = "Factors influencing the failure rate based on Relative Importance         Index (RII)",
       caption = "Source: Selected schools in Nigeria",
       x = NULL,
       y = "Relative Importance Index (RII)")
Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
ℹ Please use `linewidth` instead.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
generated.

# Assuming you have a data frame named 'rii_data' with columns: Item, RII, and Rank
library(ggplot2)

# Create a bar chart
ggplot(result_data, aes(x = Item, y = RII, fill = factor(Rank))) +
  geom_bar(stat = "identity") +
  labs(title = "Relative Importance Index (RII) Analysis",
       x = "Items",
       y = "RII") +
  scale_fill_manual(values = rainbow(length(unique(result_data$Rank)))) +  # Color bars based on Rank
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))  # Rotate x-axis labels for better readability

Interpretation of Results

The Relative Importance Index (RII) analysis was conducted to assess the perceived significance of various factors contributing to the failure rate in mathematics, based on responses from surveyed participants. The factors, represented by eight items (FR1 to FR8), were ranked according to their RII values, which provide a relative measure of importance. The RII is calculated as the weighted mean of respondents’ ratings for each item, taking into account the Likert scale weights (1 to 5).

The factor with the highest RII value and top ranking is “My teacher is not friendly” (FR2), indicating that students consider the friendliness of their teacher as the most crucial factor influencing the failure rate in mathematics. This suggests that a positive teacher-student relationship is paramount to students’ success in the subject.

The second most important factor is “Mathematics is difficult” (FR1), with a closely ranked RII value. This underscores the perception among students that the inherent difficulty of the subject significantly contributes to the challenges they face.

“I don’t think I can pass Mathematics” (FR4) is ranked third, emphasizing the impact of students’ lack of confidence in their ability to succeed in mathematics on the overall failure rate. This psychological aspect plays a notable role in students’ academic performance.

On the other hand, factors such as “My elder brother and sister also find it difficult” (FR7) and “My parents discouraged me” (FR6) were ranked lower in terms of importance. While still considered relevant, they are perceived as having a comparatively lesser impact on students’ struggles with mathematics.

In conclusion, the RII analysis highlights the multifaceted nature of factors influencing the failure rate in mathematics. It provides valuable insights for educators, policymakers, and parents to prioritize interventions that address the most critical aspects affecting students’ performance in the subject. The results emphasize the importance of fostering positive teacher-student relationships and addressing the perceived difficulty of mathematics to improve overall academic outcomes.