Introduction

Public perception of government performance is a critical factor in shaping national policy and fostering social trust. In Nigeria, where economic challenges such as unemployment, corruption, and inadequate infrastructure are prevalent, understanding how citizens perceive their government’s handling of these issues is essential. This literature review explores the existing body of knowledge on public perceptions of government performance, particularly in relation to economic management, and highlights the methodological approaches used to analyze such perceptions, with a focus on association rule mining.

Public Perception and Government Performance

Public perception of government performance is a multifaceted construct influenced by various socio-economic and political factors. Studies have shown that citizens’ trust in government is closely tied to their perceptions of economic management, job creation, corruption control, and infrastructure development (Bratton & Mattes, 2001; Cho & Logan, 2014). In Nigeria, where economic instability and corruption are persistent issues, public opinion on government performance is often negative, particularly among younger demographics (Afrobarometer, 2023).

The Afrobarometer surveys, which capture public opinion across African countries, provide valuable insights into these perceptions. The 2023 Nigeria dataset, for instance, includes responses on key governance topics such as economic management, job creation, and corruption control, making it a rich resource for analyzing public sentiment (Afrobarometer, 2023).

Economic Perception and Demographic Factors

Demographic factors such as age, education, and employment status significantly influence how individuals perceive government performance. Younger populations, particularly those aged 18 to 35, are often more critical of government actions, especially in areas like job creation and corruption control (Bratton & Mattes, 2001). This demographic is also more likely to express dissatisfaction with economic conditions, given the high levels of youth unemployment in Nigeria (National Bureau of Statistics, 2023).

Studies have also shown that perceptions of economic management are closely linked to broader socio-economic conditions. For example, individuals who perceive the economy as worsening are more likely to view government performance negatively, particularly if they also believe that corruption is rampant and infrastructure is poorly maintained (Cho & Logan, 2014).

Methodological Approaches to Analyzing Public Perception Various methodological approaches have been employed to analyze public perception data, including regression analysis, factor analysis, and machine learning techniques. Association rule mining, a machine learning method, has gained popularity for its ability to uncover hidden patterns and relationships within large datasets (Agrawal et al., 1993). The Apriori algorithm, in particular, is widely used for this purpose due to its efficiency in generating association rules from transactional data.

In the context of public perception analysis, association rule mining can reveal significant relationships between different perceptions and demographic factors. For example, it can identify that individuals who believe the economy is mismanaged are also likely to perceive corruption as a major issue and infrastructure as poorly maintained (Afrobarometer, 2023). This approach provides actionable insights for policymakers by highlighting the key factors driving public dissatisfaction.

Application of Association Rule Mining in The Survey Dataset

This study applies association rule mining to the Afrobarometer 2023 Nigeria dataset to explore the relationships between public perceptions of government performance and various economic indicators. The study focuses on key areas such as economic management, job creation, corruption control, and infrastructure development, with a particular emphasis on the perceptions of younger demographics (18 to 35 years old).

The analysis reveals several significant associations. For instance, respondents aged 46 to 55 who believe that jobs are not being created and feel unfairly treated by the government are highly likely to perceive the economy as being mismanaged. Similarly, younger respondents (18 to 25) who believe the economy will remain the same are likely to belong to this age group, indicating a generational divide in perceptions of economic management.

These findings align with existing literature, which suggests that younger populations are more critical of government performance, particularly in areas like job creation and corruption control (Bratton & Mattes, 2001). The study also highlights the importance of addressing corruption and infrastructure quality to improve public perceptions of economic management.

Now we proceed with our analysis

Data Preparation

First, we install and load the required libraries.

# Install required libraries (if not already installed)
# install.packages("tidyverse")
# install.packages("haven")
# install.packages("arules")
# install.packages("arulesViz")
# install.packages("arulesCBA")

# Load libraries
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(haven)
library(arules)
## Loading required package: Matrix
## 
## Attaching package: 'Matrix'
## 
## The following objects are masked from 'package:tidyr':
## 
##     expand, pack, unpack
## 
## 
## Attaching package: 'arules'
## 
## The following object is masked from 'package:dplyr':
## 
##     recode
## 
## The following objects are masked from 'package:base':
## 
##     abbreviate, write
library(arulesViz)
library(arulesCBA)

Next, we read the dataset and select the relevant columns for analysis.

# Read the dataset
data <- read_sav("afrobarometer_release-dataset_nig_r9_en_2023-04-01.sav")


# Select relevant columns
NewData <- data %>%
  select(1, 35, 38:42, 102, 167, 169, 176, 177)

# View the data
head(NewData)
## # A tibble: 6 × 12
##   RESPNO  Q1     Q3      Q4A     Q4B     Q5A     Q5B     Q33I    Q46A    Q46C   
##   <chr>   <dbl+> <dbl+l> <dbl+l> <dbl+l> <dbl+l> <dbl+l> <dbl+l> <dbl+l> <dbl+l>
## 1 NIG0001 24     1 [Goi… 2 [Fai… 2 [Fai… 3 [Sam… 4 [Bet… 2 [Oft… 1 [Ver… 2 [Fai…
## 2 NIG0002 45     1 [Goi… 2 [Fai… 2 [Fai… 2 [Wor… 3 [Sam… 1 [Som… 3 [Fai… 1 [Ver…
## 3 NIG0003 18     1 [Goi… 1 [Ver… 1 [Ver… 4 [Bet… 4 [Bet… 1 [Som… 1 [Ver… 1 [Ver…
## 4 NIG0004 35     2 [Goi… 4 [Fai… 4 [Fai… 4 [Bet… 3 [Sam… 2 [Oft… 3 [Fai… 2 [Fai…
## 5 NIG0005 29     1 [Goi… 1 [Ver… 1 [Ver… 1 [Muc… 2 [Wor… 2 [Oft… 1 [Ver… 1 [Ver…
## 6 NIG0006 40     2 [Goi… 4 [Fai… 4 [Fai… 3 [Sam… 5 [Muc… 2 [Oft… 2 [Fai… 3 [Fai…
## # ℹ 2 more variables: Q46J <dbl+lbl>, Q46K <dbl+lbl>

We ensure all selected columns are in numeric format for analysis.

# Convert columns to numeric
NewData <- NewData %>%
  mutate(across(2:12, as.numeric))

Now, we add descriptive names to the categories based on the questionnaire.

# Add descriptive names to categories
NewData <- NewData %>%
  mutate(
    Age = case_when(
      Q1 >= 18 & Q1 < 26  ~ "18 to 25",
      Q1 >= 26 & Q1 < 36  ~ "26 to 35",
      Q1 >= 36 & Q1 < 46  ~ "36 to 45",
      Q1 >= 46 & Q1 < 56  ~ "46 to 55",
      Q1 >= 56 ~ "56 & above",
      TRUE ~ NA_character_
    ),
    Overall_direction_of_the_country = case_when(
      Q3 == 1 ~ "Going in the wrong direction",
      Q3 == 2 ~ "Going in the right direction",
      Q3 >= 3 ~ "Don't know the direction of the country", 
      TRUE ~ NA_character_
    ),
    Country_present_economic_condition = case_when(
      Q4A <= 2 ~ "The economy is bad",
      Q4A == 3 ~ "Neutral on the economy",
      Q4A >= 4 & Q4A <= 5 ~ "The economy is good",
      Q4A >= 6 ~ "Don’t know about the economy", 
      TRUE ~ NA_character_
    ),
    Your_present_living_conditions = case_when(
      Q4B <= 2 ~ "Bad living condition",
      Q4B == 3 ~ "Neither Good nor Bad living condition",
      Q4B >= 4 & Q4B <= 5 ~ "Good living condition",
      Q4B >= 6 ~ "Can’t say Good or Bad living condition", 
      TRUE ~ NA_character_
    ),
    Country_economic_condition_compared_to_12_months_ago = case_when(
      Q5A <= 2 ~ "Economy has become worse",
      Q5A == 3 ~ "Economy is same",
      Q5A >= 4 & Q5A <= 5 ~ "Economy is better",
      Q5A >= 6 ~ "Don’t know if it’s better or not", 
      TRUE ~ NA_character_
    ),
    Country_economic_condition_in_12_months_time = case_when(
      Q5B <= 2 ~ "Economy will become worse",
      Q5B == 3 ~ "Economy will be the same",
      Q5B >= 4 & Q5B <= 5 ~ "Economy will be better",
      Q5B >= 6 ~ "Don’t know the future of the Economy", 
      TRUE ~ NA_character_
    ),
    Treated_unfairly_by_government_based_on_economic_status = case_when(
      Q33I == 1 ~ "Never been treated unfairly by the Government",
      Q33I >= 2 & Q33I <= 4 ~ "Treated unfairly by the Government",
      Q33I == 0 | Q33I >= 5 ~ "Can’t Say If I have been treated unfairly by the Government", 
      TRUE ~ NA_character_
    ),
    Handling_managing_the_economy = case_when(
      Q46A <= 2 ~ "Mismanaging the economy",
      Q46A >= 3 & Q46A <= 4 ~ "Managing the economy well",
      Q46A >= 5 ~ "No Opinion on Management of the economy", 
      TRUE ~ NA_character_
    ),
    Creating_jobs = case_when(
      Q46C <= 2 ~ "Not Creating jobs",
      Q46C >= 3 & Q46C <= 4 ~ "Creating jobs",
      Q46C >= 5 ~ "Don’t know about jobs creations", 
      TRUE ~ NA_character_
    ),
    Handling_fighting_corruption = case_when(
      Q46J <= 2 ~ "Not Fighting Corruption",
      Q46J >= 3 & Q46J <= 4 ~ "Fighting Corruption",
      Q46J >= 5 ~ "Don’t know about Fighting Corruption", 
      TRUE ~ NA_character_
    ),
    Handling_maintaining_roads_and_bridges = case_when(
      Q46K <= 2 ~ "Not maintaining roads and bridges",
      Q46K >= 3 & Q46K <= 4 ~ "Maintaining roads and bridges",
      Q46K >= 5 ~ "Don’t know about Maintaining roads and bridges", 
      TRUE ~ NA_character_
    )
  )

# Display the first few rows of the processed data
head(NewData)
## # A tibble: 6 × 23
##   RESPNO    Q1    Q3   Q4A   Q4B   Q5A   Q5B  Q33I  Q46A  Q46C  Q46J  Q46K Age  
##   <chr>  <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr>
## 1 NIG00…    24     1     2     2     3     4     2     1     2     2     2 18 t…
## 2 NIG00…    45     1     2     2     2     3     1     3     1     3     3 36 t…
## 3 NIG00…    18     1     1     1     4     4     1     1     1     1     3 18 t…
## 4 NIG00…    35     2     4     4     4     3     2     3     2     1     4 26 t…
## 5 NIG00…    29     1     1     1     1     2     2     1     1     2     3 26 t…
## 6 NIG00…    40     2     4     4     3     5     2     2     3     2     4 36 t…
## # ℹ 10 more variables: Overall_direction_of_the_country <chr>,
## #   Country_present_economic_condition <chr>,
## #   Your_present_living_conditions <chr>,
## #   Country_economic_condition_compared_to_12_months_ago <chr>,
## #   Country_economic_condition_in_12_months_time <chr>,
## #   Treated_unfairly_by_government_based_on_economic_status <chr>,
## #   Handling_managing_the_economy <chr>, Creating_jobs <chr>, …

We check for missing values in the dataset.

# Check for missing values
colSums(is.na(NewData))
##                                                  RESPNO 
##                                                       0 
##                                                      Q1 
##                                                       0 
##                                                      Q3 
##                                                       0 
##                                                     Q4A 
##                                                       0 
##                                                     Q4B 
##                                                       0 
##                                                     Q5A 
##                                                       0 
##                                                     Q5B 
##                                                       0 
##                                                    Q33I 
##                                                       0 
##                                                    Q46A 
##                                                       0 
##                                                    Q46C 
##                                                       0 
##                                                    Q46J 
##                                                       0 
##                                                    Q46K 
##                                                       0 
##                                                     Age 
##                                                       0 
##                        Overall_direction_of_the_country 
##                                                       0 
##                      Country_present_economic_condition 
##                                                       0 
##                          Your_present_living_conditions 
##                                                       0 
##    Country_economic_condition_compared_to_12_months_ago 
##                                                       0 
##            Country_economic_condition_in_12_months_time 
##                                                       0 
## Treated_unfairly_by_government_based_on_economic_status 
##                                                       0 
##                           Handling_managing_the_economy 
##                                                       0 
##                                           Creating_jobs 
##                                                       0 
##                            Handling_fighting_corruption 
##                                                       0 
##                  Handling_maintaining_roads_and_bridges 
##                                                       0

Association Rule Mining

For this analysis we will be focusing on the perception of the population on the governments management of the economy and the thoughts of the millenials (“26 to 35”) and genz’s (“18 to 25”).

We prepare the data for association rule mining by transforming it into transactional format.

# Prepare data for transactions
AltData <- NewData %>% 
  select(1, 13:23) %>%
  pivot_longer(cols = -RESPNO, names_to = "Question", values_to = "Response") %>%
  select(RESPNO, Response)

# Save the data as CSV
write_csv(AltData, "govrating.csv")

# Read the data as transactions
trans1 <- read.transactions("govrating.csv", format="single", sep=",", cols = c(1,2))
## Warning in scan(file = file, sep = sep, quote = quote, what = what, flush =
## TRUE, : EOF within quoted string
# Basic checks on transaction data
summary(trans1)
## transactions as itemMatrix in sparse format with
##  826 rows (elements/itemsets/transactions) and
##  49 columns (items) and a density of 0.2213026 
## 
## most frequent items:
## Going in the wrong direction      Mismanaging the economy 
##                          712                          708 
##            Not Creating jobs           The economy is bad 
##                          688                          666 
##      Not Fighting Corruption                      (Other) 
##                          663                         5520 
## 
## element (itemset/transaction) length distribution:
## sizes
##   1   2   9  11 
##   1  11  10 804 
## 
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    1.00   11.00   11.00   10.84   11.00   11.00 
## 
## includes extended item information - examples:
##     labels
## 1 18 to 25
## 2 26 to 35
## 3 36 to 45
## 
## includes extended transaction information - examples:
##   transactionID
## 1       NIG0001
## 2       NIG0002
## 3       NIG0003
LIST(head(trans1))
## $NIG0001
##  [1] "18 to 25"                           "Bad living condition"              
##  [3] "Economy is same"                    "Economy will be better"            
##  [5] "Going in the wrong direction"       "Mismanaging the economy"           
##  [7] "Not Creating jobs"                  "Not Fighting Corruption"           
##  [9] "Not maintaining roads and bridges"  "The economy is bad"                
## [11] "Treated unfairly by the Government"
## 
## $NIG0002
##  [1] "36 to 45"                                     
##  [2] "Bad living condition"                         
##  [3] "Economy has become worse"                     
##  [4] "Economy will be the same"                     
##  [5] "Fighting Corruption"                          
##  [6] "Going in the wrong direction"                 
##  [7] "Maintaining roads and bridges"                
##  [8] "Managing the economy well"                    
##  [9] "Never been treated unfairly by the Government"
## [10] "Not Creating jobs"                            
## [11] "The economy is bad"                           
## 
## $NIG0003
##  [1] "18 to 25"                                     
##  [2] "Bad living condition"                         
##  [3] "Economy is better"                            
##  [4] "Economy will be better"                       
##  [5] "Going in the wrong direction"                 
##  [6] "Maintaining roads and bridges"                
##  [7] "Mismanaging the economy"                      
##  [8] "Never been treated unfairly by the Government"
##  [9] "Not Creating jobs"                            
## [10] "Not Fighting Corruption"                      
## [11] "The economy is bad"                           
## 
## $NIG0004
##  [1] "26 to 35"                           "Economy is better"                 
##  [3] "Economy will be the same"           "Going in the right direction"      
##  [5] "Good living condition"              "Maintaining roads and bridges"     
##  [7] "Managing the economy well"          "Not Creating jobs"                 
##  [9] "Not Fighting Corruption"            "The economy is good"               
## [11] "Treated unfairly by the Government"
## 
## $NIG0005
##  [1] "26 to 35"                           "Bad living condition"              
##  [3] "Economy has become worse"           "Economy will become worse"         
##  [5] "Going in the wrong direction"       "Maintaining roads and bridges"     
##  [7] "Mismanaging the economy"            "Not Creating jobs"                 
##  [9] "Not Fighting Corruption"            "The economy is bad"                
## [11] "Treated unfairly by the Government"
## 
## $NIG0006
##  [1] "36 to 45"                           "Creating jobs"                     
##  [3] "Economy is same"                    "Economy will be better"            
##  [5] "Going in the right direction"       "Good living condition"             
##  [7] "Maintaining roads and bridges"      "Mismanaging the economy"           
##  [9] "Not Fighting Corruption"            "The economy is good"               
## [11] "Treated unfairly by the Government"

Let’s visualize the top 10 most frequent items in the transactions.

# Plot top 10 most frequent items
itemFrequencyPlot(trans1, topN=10, type="absolute", main="Top 10 Most Frequent Items")

itemFrequencyPlot(trans1, topN=10, type="relative", main="Relative Frequency of Top 10 Items")

From the plot, we can see that “Mismanaging the economy” and “Going in the wrong direction” is the top most occurring transaction, followed by “Not Fighting Corruption,” reflecting the most popular perceptions from the survey.

Rule Mining: Mismanaging the Economy

We start by mining rules for “Mismanaging the economy” with a support of 5% and confidence of 80%.

# Rule mining for "Mismanaging the economy"
rules_MismanagingEconomy <- apriori(
  data = trans1, 
  parameter = list(supp = 0.05, conf = 0.80), 
  appearance = list(default = "lhs", rhs = "Mismanaging the economy"), 
  control = list(verbose = FALSE)
)

# Sort rules by confidence
rules_sorted_mismanage <- sort(rules_MismanagingEconomy, by = "confidence", decreasing = TRUE)

# Inspect the top rules
inspect(head(rules_sorted_mismanage))
##     lhs                                                 rhs                          support confidence   coverage     lift count
## [1] {46 to 55,                                                                                                                   
##      Not Creating jobs,                                                                                                          
##      Treated unfairly by the Government}             => {Mismanaging the economy} 0.05447942          1 0.05447942 1.166667    45
## [2] {Economy will become worse,                                                                                                  
##      Never been treated unfairly by the Government,                                                                              
##      Not Fighting Corruption}                        => {Mismanaging the economy} 0.05932203          1 0.05932203 1.166667    49
## [3] {46 to 55,                                                                                                                   
##      Economy has become worse,                                                                                                   
##      Not Creating jobs,                                                                                                          
##      Treated unfairly by the Government}             => {Mismanaging the economy} 0.05326877          1 0.05326877 1.166667    44
## [4] {46 to 55,                                                                                                                   
##      Going in the wrong direction,                                                                                               
##      Not Creating jobs,                                                                                                          
##      Treated unfairly by the Government}             => {Mismanaging the economy} 0.05084746          1 0.05084746 1.166667    42
## [5] {Economy will be the same,                                                                                                   
##      Not Creating jobs,                                                                                                          
##      The economy is bad,                                                                                                         
##      Treated unfairly by the Government}             => {Mismanaging the economy} 0.08595642          1 0.08595642 1.166667    71
## [6] {Economy has become worse,                                                                                                   
##      Economy will become worse,                                                                                                  
##      Never been treated unfairly by the Government,                                                                              
##      Not Fighting Corruption}                        => {Mismanaging the economy} 0.05084746          1 0.05084746 1.166667    42

Insights:

  • Respondents aged 46 to 55 who believe that jobs are not being created and feel unfairly treated by the government are highly likely to perceive the economy as being mismanaged, with a confidence of 100% and a lift of 1.17. The support for this rule is 5.45%.
  • Individuals who believe the economy will worsen, have never been treated unfairly by the government, and think corruption is not being fought also strongly associate this with the economy being mismanaged, with a 100% confidence and a lift of 1.17. The support for this rule is 5.93%. Respondents aged 46 to 55 who believe the economy has worsened, jobs are not being created, and they have been treated unfairly by the government are also likely to view the economy as mismanaged, with a 100% confidence and a lift of 1.17. This rule has a support of 5.33%.
  • Respondents aged 46 to 55 who feel the country is heading in the wrong direction, jobs are not being created, and they’ve been treated unfairly by the government also strongly associate these conditions with economic mismanagement, with a 100% confidence and a lift of 1.17. The support for this rule is 5.08%.
  • Those who believe the economy will stay the same, jobs are not being created, the economy is bad, and they’ve been treated unfairly by the government are highly likely to perceive economic mismanagement, with a 100% confidence and a lift of 1.17. The support here is the highest at 8.60%.
  • Respondents who think the economy has worsened, will worsen further, and that corruption is not being fought, while never feeling unfairly treated by the government, also strongly associate these beliefs with economic mismanagement, with a 100% confidence and a lift of 1.17. The support for this rule is 5.08%.

Rule Mining: Managing the Economy Well

Next, we mine rules for “Managing the economy well” with a lower confidence level of 10% (higher confidence levels did not generate rules).

# Rule mining for "Managing the economy well"
rules_Managingtheeconomywell <- apriori(
  data = trans1, 
  parameter = list(supp = 0.05, conf = 0.10), 
  appearance = list(default = "lhs", rhs = "Managing the economy well"), 
  control = list(verbose = FALSE)
)

# Sort rules by confidence
rules_sorted_manage <- sort(rules_Managingtheeconomywell, by = "confidence", decreasing = TRUE)

# Inspect the top rules
inspect(head(rules_sorted_manage))
##     lhs                                rhs                            support confidence  coverage     lift count
## [1] {Creating jobs}                 => {Managing the economy well} 0.06053269  0.4032258 0.1501211 3.202543    50
## [2] {Fighting Corruption}           => {Managing the economy well} 0.07142857  0.4013605 0.1779661 3.187729    59
## [3] {Maintaining roads and bridges} => {Managing the economy well} 0.06900726  0.2183908 0.3159806 1.734527    57
## [4] {Economy will be better}        => {Managing the economy well} 0.07748184  0.1592040 0.4866828 1.264447    64
## [5] {}                              => {Managing the economy well} 0.12590799  0.1259080 1.0000000 1.000000   104

Insights:

  • Respondents who believe that jobs are being created are likely to think the economy is being managed well, with a confidence of 40.3% and a lift of 3.20. The support for this rule is 6.05%.
  • Those who feel that corruption is being fought are also likely to view the economy as being well managed, with a confidence of 40.1% and a lift of 3.19. The support here is 7.14%.
  • Respondents who believe that roads and bridges are being maintained are somewhat likely to perceive the economy as being managed well, with a lower confidence of 21.8% and a lift of 1.73. This rule has a support of 6.90%.
  • Individuals who believe the economy will improve are likely to perceive good management of the economy, with a confidence of 15.9% and a lift of 1.26. The support for this rule is 7.75%.
  • The rule with no antecedents (i.e., general perceptions of the economy being managed well) has the highest support at 12.59%, but with a lower lift of 1.00, indicating it is a baseline perception.

Rule Mining: Gen Z (18 to 25)

We now focus on the perceptions of Gen Z (“18 to 25”) with a support of 5% and confidence of 10%.

# Rule mining for Gen Z (18 to 25)
rules_18_to_25 <- apriori(
  data = trans1, 
  parameter = list(supp = 0.05, conf = 0.10), 
  appearance = list(default = "lhs", rhs = "18 to 25"), 
  control = list(verbose = FALSE)
)

# Sort rules by confidence
rules_sorted_18_to_25 <- sort(rules_18_to_25, by = "confidence", decreasing = TRUE)

# Inspect the top rules
inspect(head(rules_sorted_18_to_25))
##     lhs                                                 rhs           support confidence  coverage     lift count
## [1] {Economy is same}                                => {18 to 25} 0.05084746  0.3387097 0.1501211 1.271701    42
## [2] {Never been treated unfairly by the Government,                                                              
##      The economy is bad}                             => {18 to 25} 0.05811138  0.3178808 0.1828087 1.193498    48
## [3] {Economy will be better,                                                                                     
##      Not Creating jobs,                                                                                          
##      Not maintaining roads and bridges}              => {18 to 25} 0.08837772  0.3160173 0.2796610 1.186501    73
## [4] {Economy will be better,                                                                                     
##      Not Fighting Corruption,                                                                                    
##      Not maintaining roads and bridges,                                                                          
##      The economy is bad}                             => {18 to 25} 0.07627119  0.3150000 0.2421308 1.182682    63
## [5] {Economy will be better,                                                                                     
##      Not maintaining roads and bridges,                                                                          
##      The economy is bad}                             => {18 to 25} 0.08595642  0.3141593 0.2736077 1.179525    71
## [6] {Fighting Corruption}                            => {18 to 25} 0.05569007  0.3129252 0.1779661 1.174892    46

Insights:

  • Respondents who believe the economy will remain the same are likely to be in the 18 to 25 age group, with a confidence of 33.9% and a lift of 1.27. The support for this rule is 5.08%.
  • Individuals who have never been treated unfairly by the government and think the economy is bad are also likely to be in the 18 to 25 age group, with a confidence of 31.8% and a lift of 1.19. The support here is 5.81%.
  • Respondents who believe the economy will improve, feel jobs are not being created, and that roads and bridges are not being maintained are likely to be in the 18 to 25 age group, with a confidence of 31.6% and a lift of 1.19. The support for this rule is 8.84%.
  • Those who believe the economy will improve, think corruption is not being fought, and feel roads and bridges are not being maintained, while perceiving the economy as bad, are also likely to be in the 18 to 25 age group, with a confidence of 31.5% and a lift of 1.18. The support for this rule is 7.63%.
  • Respondents who believe the economy will improve, think roads and bridges are not being maintained, and feel the economy is bad are likely to be in the 18 to 25 age group, with a confidence of 31.4% and a lift of 1.18. The support here is 8.60%.
  • Those who believe corruption is being fought are also likely to be in the 18 to 25 age group, with a confidence of 31.3% and a lift of 1.17. The support for this rule is 5.57%.

Rule Mining: Millennials (26 to 35)

Finally, we analyze the perceptions of millennials (“26 to 35”) with a support of 5% and confidence of 10%.

# Rule mining for Millennials (26 to 35)
rules_26_to_35 <- apriori(
  data = trans1, 
  parameter = list(supp = 0.05, conf = 0.10), 
  appearance = list(default = "lhs", rhs = "26 to 35"), 
  control = list(verbose = FALSE)
)

# Sort rules by confidence
rules_sorted_26_to_35 <- sort(rules_26_to_35, by = "confidence", decreasing = TRUE)

# Inspect the top rules
inspect(head(rules_sorted_26_to_35))
##     lhs                                    rhs           support confidence  coverage     lift count
## [1] {Economy has become worse,                                                                      
##      Going in the wrong direction,                                                                  
##      Maintaining roads and bridges,                                                                 
##      Mismanaging the economy,                                                                       
##      Not Fighting Corruption}           => {26 to 35} 0.05326877  0.4190476 0.1271186 1.272549    44
## [2] {Economy has become worse,                                                                      
##      Maintaining roads and bridges,                                                                 
##      Mismanaging the economy,                                                                       
##      Not Fighting Corruption}           => {26 to 35} 0.05569007  0.4144144 0.1343826 1.258479    46
## [3] {Economy has become worse,                                                                      
##      Maintaining roads and bridges,                                                                 
##      Not Fighting Corruption}           => {26 to 35} 0.05811138  0.4033613 0.1440678 1.224913    48
## [4] {Economy has become worse,                                                                      
##      Going in the wrong direction,                                                                  
##      Maintaining roads and bridges,                                                                 
##      Not Fighting Corruption}           => {26 to 35} 0.05447942  0.4017857 0.1355932 1.220129    45
## [5] {Creating jobs}                     => {26 to 35} 0.05932203  0.3951613 0.1501211 1.200012    49
## [6] {Economy has become worse,                                                                      
##      Economy will become worse,                                                                     
##      Not Fighting Corruption,                                                                       
##      Not maintaining roads and bridges} => {26 to 35} 0.06295400  0.3939394 0.1598063 1.196301    52

Insights:

  • Respondents aged 26 to 35 who believe the economy has worsened, that the country is heading in the wrong direction, that roads and bridges are being maintained, and that corruption is not being fought are highly likely to belong to this age group, with a confidence of 41.9% and a lift of 1.27. The support for this rule is 5.33%.
  • Individuals who perceive the economy as worsened, roads and bridges maintained, the economy mismanaged, and corruption unchecked are also likely to be in the 26 to 35 age group, with a confidence of 41.4% and a lift of 1.26. The support here is 5.57%.
  • Respondents who think the economy has worsened, roads and bridges are maintained, and corruption is not being fought are similarly likely to belong to the 26 to 35 group, with a confidence of 40.3% and a lift of 1.22. The support for this rule is 5.81%.
  • Those who believe the economy has worsened, the country is going in the wrong direction, and roads and bridges are maintained, but corruption is not being fought, are likely to belong to the 26 to 35 age group, with a confidence of 40.2% and a lift of 1.22. The support for this rule is 5.45%.
  • Respondents who believe jobs are being created are likely to be in the 26 to 35 age group, with a confidence of 39.5% and a lift of 1.20. The support for this rule is 5.93%.
  • Individuals who believe the economy has worsened, will worsen further, and that corruption is not being fought while roads and bridges are not maintained are also likely to be in this age group, with a confidence of 39.4% and a lift of 1.20. The support for this rule is 6.30%.

Visualization

We visualize the rules for “Mismanaging the economy” using various plots.

# Plot rules for "Mismanaging the economy"
top_rules <- head(sort(rules_MismanagingEconomy, by="lift"), 20)
plot(top_rules, measure=c("support", "lift"), shading="confidence")
## To reduce overplotting, jitter is added! Use jitter = 0 to prevent jitter.

plot(top_rules, method="graph", control=list(type="items"))
## Warning: Unknown control parameters: type
## Available control parameters (with default values):
## layout    =  stress
## circular  =  FALSE
## ggraphdots    =  NULL
## edges     =  <environment>
## nodes     =  <environment>
## nodetext  =  <environment>
## colors    =  c("#EE0000FF", "#EEEEEEFF")
## engine    =  ggplot2
## max   =  100
## verbose   =  FALSE

plot(top_rules, method="paracoord", control=list(reorder=TRUE))

plot(top_rules, shading="order", control=list(main="Two-key plot"))
## To reduce overplotting, jitter is added! Use jitter = 0 to prevent jitter.

Conclusion

This analysis explored the associations between perceptions of economic mismanagement and various socio-economic factors, such as age groups, corruption, and infrastructure quality. Association rule mining was used to identify key relationships between these factors.

The findings revealed that mismanagement of the economy is strongly associated with perceptions of corruption and poor infrastructure, particularly among the 26 to 35 age group. This group showed a strong correlation with not fighting corruption, not creating jobs, and not maintaining roads and bridges, all contributing to perceptions of economic mismanagement. For the 18 to 25 group, economic decline and infrastructure issues were also key drivers, but the correlation was less pronounced compared to older groups.

Conversely, the 26 to 35 age group also showed a strong association with perceptions of economic mismanagement, which was connected to factors like economic deterioration and the absence of anti-corruption efforts. Meanwhile, younger respondents (18 to 25) who felt the economy was worsening or stagnating, and who also observed poor maintenance of infrastructure and a lack of anti-corruption initiatives, were more likely to associate these perceptions with economic mismanagement.

These results highlight the importance of addressing corruption, job creation, and infrastructure quality to improve economic perceptions across various age groups. Future studies could explore additional factors, such as education level or employment status, to uncover more comprehensive insights into the public’s perception of economic management.

References

Afrobarometer. (2023). Nigeria Round 9 Data (2023). Retrieved from https://www.afrobarometer.org/survey-resource/nigeria-round-9-data-2023/

Agrawal, R., Imieliński, T., & Swami, A. (1993). Mining association rules between sets of items in large databases. ACM SIGMOD Record, 22(2), 207-216.

Bratton, M., & Mattes, R. (2001). Support for democracy in Africa: Intrinsic or instrumental? British Journal of Political Science, 31(3), 447-474.

Cho, W., & Logan, C. (2014). Looking toward the future: Alternations in power and popular perspectives on democratic durability in Africa. Comparative Political Studies, 47(1), 30-54. ```