library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.4
## ✔ 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(janitor)
## Warning: package 'janitor' was built under R version 4.3.3
## 
## Attaching package: 'janitor'
## 
## The following objects are masked from 'package:stats':
## 
##     chisq.test, fisher.test
library(googlesheets4)
library(lubridate)
library(DT)
gs4_auth()
## ℹ Suitable tokens found in the cache, associated with these emails:
## • 'aomutobe@dotrust.org'
## • 'omutove@gmail.com'
## • 'ookostephen8@gmail.com'
##   Defaulting to the first email.
## ! Using an auto-discovered, cached token.
##   To suppress this message, modify your code or options to clearly consent to
##   the use of a cached token.
##   See gargle's "Non-interactive auth" vignette for more details:
##   <https://gargle.r-lib.org/articles/non-interactive-auth.html>
## ℹ The googlesheets4 package is using a cached token for 'aomutobe@dotrust.org'.
url <- ("https://docs.google.com/spreadsheets/d/19O9LZ1JF70xNAqiWFRN-8Y9hAcIzDhufpjRGmYz7-vw/edit?resourcekey=&gid=966558388#gid=966558388")

data <- read_sheet(url, 1)
## ✔ Reading from "Outcome evaluation  (Responses)".
## ✔ Range ''Form Responses 1''.
dim(data)
## [1] 267  57
names(data)
##  [1] "Timestamp"                                                                                                                       
##  [2] "Email Address"                                                                                                                   
##  [3] "1.Your Name"                                                                                                                     
##  [4] "2.Date  birth"                                                                                                                   
##  [5] "3.Gender"                                                                                                                        
##  [6] "4.Current location"                                                                                                              
##  [7] "5.Highest level of education"                                                                                                    
##  [8] "6.Which of the following digital devices do you have access to ?"                                                                
##  [9] "7. Do you have access to the internet on a regular basis ?"                                                                      
## [10] "8.If you have regular access to the internet , how do you access it?"                                                            
## [11] "9. Are you a digital content creator?"                                                                                           
## [12] "10.What were your expectations before starting the program?"                                                                     
## [13] "11.Before the program, how would you rate your digital content creation skills?"                                                 
## [14] "12. How satisfied were you with the training program overall?"                                                                   
## [15] "13. What did you like most about the program?"                                                                                   
## [16] "14. Do you feel the program addressed the challenges you faced in creating digital content?"                                     
## [17] "15.After the program, how would you rate your digital content creation skills?"                                                  
## [18] "16.On a scale of 1–5, how relevant was the program content to your needs?"                                                       
## [19] "17.Please indicate which of the following skills you gained or improved during the program (select all that apply):"             
## [20] "18. Were you able to apply these skills after the program?"                                                                      
## [21] "19.Do you have access to tools and platforms to sustain your digital content journey?"                                           
## [22] "20.Please indicate the tools/applications/software that you are currently using for content creation"                            
## [23] "21.If yes, give examples of how you applied these tools."                                                                        
## [24] "22.Please indicate the social media platforms you are currently using to share your content."                                    
## [25] "23. On a scale of 1 to 5, how confident do you feel creating content on your own?"                                               
## [26] "24.How frequently do you create content?"                                                                                        
## [27] "25.How frequently do you publish content?"                                                                                       
## [28] "26.How many hours do you spend working in content creation in a normal week?"                                                    
## [29] "27.What challenges have you faced in the past 1 year in producing and publishing digital content"                                
## [30] "28.In a scale of 1-5, please rate your skills in the following areas.  [Videography]"                                            
## [31] "28.In a scale of 1-5, please rate your skills in the following areas.  [Photography]"                                            
## [32] "28.In a scale of 1-5, please rate your skills in the following areas.  [Graphic design]"                                         
## [33] "28.In a scale of 1-5, please rate your skills in the following areas.  [Social media management]"                                
## [34] "28.In a scale of 1-5, please rate your skills in the following areas.  [SEO and analytics]"                                      
## [35] "29.Proficiency in using content creation tools [Canva]"                                                                          
## [36] "29.Proficiency in using content creation tools [Adobe photoshop]"                                                                
## [37] "29.Proficiency in using content creation tools [Search Engine optimization]"                                                     
## [38] "29.Proficiency in using content creation tools [Social media marketing]"                                                         
## [39] "29.Proficiency in using content creation tools [Google Analytics]"                                                               
## [40] "29.Proficiency in using content creation tools [Personal branding]"                                                              
## [41] "29.Proficiency in using content creation tools [ChatGPT]"                                                                        
## [42] "29.Proficiency in using content creation tools [CupCut]"                                                                         
## [43] "29.Proficiency in using content creation tools [Shooting videos]"                                                                
## [44] "29.Proficiency in using content creation tools [Editing Videos]"                                                                 
## [45] "29.Proficiency in using content creation tools [Photography]"                                                                    
## [46] "30.Do you continue to use the skills gained from the program?"                                                                   
## [47] "31.Do you plan to continue developing your content creation skills?"                                                             
## [48] "32.Have you earned any income from your content since completing the program?"                                                   
## [49] "33.If yes, what is your estimated monthly income from content creation in Kenya shillings"                                       
## [50] "34.Which monetisation strategies do you use?"                                                                                    
## [51] "35.If content creation has not been your primary source of income, please specify your main source of income over the past year."
## [52] "36.Do you analyse your digital content creation progress including social media success?"                                        
## [53] "37.How do you currently measure the success or effectiveness of your content?"                                                   
## [54] "38.What are the most significant changes you have  experienced since completing the program?"                                    
## [55] "39.Have you influenced others to pursue digital content creation?"                                                               
## [56] "40.Reflecting on the program, what could be improved to make it better?"                                                         
## [57] "Any additional comments or success stories you would  like to share?"
#remove unwanted columns.

df <-data %>% select (-c("Timestamp", "Email Address", "1.Your Name"))

names(df)
##  [1] "2.Date  birth"                                                                                                                   
##  [2] "3.Gender"                                                                                                                        
##  [3] "4.Current location"                                                                                                              
##  [4] "5.Highest level of education"                                                                                                    
##  [5] "6.Which of the following digital devices do you have access to ?"                                                                
##  [6] "7. Do you have access to the internet on a regular basis ?"                                                                      
##  [7] "8.If you have regular access to the internet , how do you access it?"                                                            
##  [8] "9. Are you a digital content creator?"                                                                                           
##  [9] "10.What were your expectations before starting the program?"                                                                     
## [10] "11.Before the program, how would you rate your digital content creation skills?"                                                 
## [11] "12. How satisfied were you with the training program overall?"                                                                   
## [12] "13. What did you like most about the program?"                                                                                   
## [13] "14. Do you feel the program addressed the challenges you faced in creating digital content?"                                     
## [14] "15.After the program, how would you rate your digital content creation skills?"                                                  
## [15] "16.On a scale of 1–5, how relevant was the program content to your needs?"                                                       
## [16] "17.Please indicate which of the following skills you gained or improved during the program (select all that apply):"             
## [17] "18. Were you able to apply these skills after the program?"                                                                      
## [18] "19.Do you have access to tools and platforms to sustain your digital content journey?"                                           
## [19] "20.Please indicate the tools/applications/software that you are currently using for content creation"                            
## [20] "21.If yes, give examples of how you applied these tools."                                                                        
## [21] "22.Please indicate the social media platforms you are currently using to share your content."                                    
## [22] "23. On a scale of 1 to 5, how confident do you feel creating content on your own?"                                               
## [23] "24.How frequently do you create content?"                                                                                        
## [24] "25.How frequently do you publish content?"                                                                                       
## [25] "26.How many hours do you spend working in content creation in a normal week?"                                                    
## [26] "27.What challenges have you faced in the past 1 year in producing and publishing digital content"                                
## [27] "28.In a scale of 1-5, please rate your skills in the following areas.  [Videography]"                                            
## [28] "28.In a scale of 1-5, please rate your skills in the following areas.  [Photography]"                                            
## [29] "28.In a scale of 1-5, please rate your skills in the following areas.  [Graphic design]"                                         
## [30] "28.In a scale of 1-5, please rate your skills in the following areas.  [Social media management]"                                
## [31] "28.In a scale of 1-5, please rate your skills in the following areas.  [SEO and analytics]"                                      
## [32] "29.Proficiency in using content creation tools [Canva]"                                                                          
## [33] "29.Proficiency in using content creation tools [Adobe photoshop]"                                                                
## [34] "29.Proficiency in using content creation tools [Search Engine optimization]"                                                     
## [35] "29.Proficiency in using content creation tools [Social media marketing]"                                                         
## [36] "29.Proficiency in using content creation tools [Google Analytics]"                                                               
## [37] "29.Proficiency in using content creation tools [Personal branding]"                                                              
## [38] "29.Proficiency in using content creation tools [ChatGPT]"                                                                        
## [39] "29.Proficiency in using content creation tools [CupCut]"                                                                         
## [40] "29.Proficiency in using content creation tools [Shooting videos]"                                                                
## [41] "29.Proficiency in using content creation tools [Editing Videos]"                                                                 
## [42] "29.Proficiency in using content creation tools [Photography]"                                                                    
## [43] "30.Do you continue to use the skills gained from the program?"                                                                   
## [44] "31.Do you plan to continue developing your content creation skills?"                                                             
## [45] "32.Have you earned any income from your content since completing the program?"                                                   
## [46] "33.If yes, what is your estimated monthly income from content creation in Kenya shillings"                                       
## [47] "34.Which monetisation strategies do you use?"                                                                                    
## [48] "35.If content creation has not been your primary source of income, please specify your main source of income over the past year."
## [49] "36.Do you analyse your digital content creation progress including social media success?"                                        
## [50] "37.How do you currently measure the success or effectiveness of your content?"                                                   
## [51] "38.What are the most significant changes you have  experienced since completing the program?"                                    
## [52] "39.Have you influenced others to pursue digital content creation?"                                                               
## [53] "40.Reflecting on the program, what could be improved to make it better?"                                                         
## [54] "Any additional comments or success stories you would  like to share?"
#change "date of birth coulnm to a date format

df$`2.Date  birth`<- as.Date(df$`2.Date  birth`)

#create new column "Age" based on date of birth and current date 

df$age <- as.integer(
  time_length(interval(df$`2.Date  birth`, Sys.Date()), "years")
)
#Select specific columns

colnames(df)
##  [1] "2.Date  birth"                                                                                                                   
##  [2] "3.Gender"                                                                                                                        
##  [3] "4.Current location"                                                                                                              
##  [4] "5.Highest level of education"                                                                                                    
##  [5] "6.Which of the following digital devices do you have access to ?"                                                                
##  [6] "7. Do you have access to the internet on a regular basis ?"                                                                      
##  [7] "8.If you have regular access to the internet , how do you access it?"                                                            
##  [8] "9. Are you a digital content creator?"                                                                                           
##  [9] "10.What were your expectations before starting the program?"                                                                     
## [10] "11.Before the program, how would you rate your digital content creation skills?"                                                 
## [11] "12. How satisfied were you with the training program overall?"                                                                   
## [12] "13. What did you like most about the program?"                                                                                   
## [13] "14. Do you feel the program addressed the challenges you faced in creating digital content?"                                     
## [14] "15.After the program, how would you rate your digital content creation skills?"                                                  
## [15] "16.On a scale of 1–5, how relevant was the program content to your needs?"                                                       
## [16] "17.Please indicate which of the following skills you gained or improved during the program (select all that apply):"             
## [17] "18. Were you able to apply these skills after the program?"                                                                      
## [18] "19.Do you have access to tools and platforms to sustain your digital content journey?"                                           
## [19] "20.Please indicate the tools/applications/software that you are currently using for content creation"                            
## [20] "21.If yes, give examples of how you applied these tools."                                                                        
## [21] "22.Please indicate the social media platforms you are currently using to share your content."                                    
## [22] "23. On a scale of 1 to 5, how confident do you feel creating content on your own?"                                               
## [23] "24.How frequently do you create content?"                                                                                        
## [24] "25.How frequently do you publish content?"                                                                                       
## [25] "26.How many hours do you spend working in content creation in a normal week?"                                                    
## [26] "27.What challenges have you faced in the past 1 year in producing and publishing digital content"                                
## [27] "28.In a scale of 1-5, please rate your skills in the following areas.  [Videography]"                                            
## [28] "28.In a scale of 1-5, please rate your skills in the following areas.  [Photography]"                                            
## [29] "28.In a scale of 1-5, please rate your skills in the following areas.  [Graphic design]"                                         
## [30] "28.In a scale of 1-5, please rate your skills in the following areas.  [Social media management]"                                
## [31] "28.In a scale of 1-5, please rate your skills in the following areas.  [SEO and analytics]"                                      
## [32] "29.Proficiency in using content creation tools [Canva]"                                                                          
## [33] "29.Proficiency in using content creation tools [Adobe photoshop]"                                                                
## [34] "29.Proficiency in using content creation tools [Search Engine optimization]"                                                     
## [35] "29.Proficiency in using content creation tools [Social media marketing]"                                                         
## [36] "29.Proficiency in using content creation tools [Google Analytics]"                                                               
## [37] "29.Proficiency in using content creation tools [Personal branding]"                                                              
## [38] "29.Proficiency in using content creation tools [ChatGPT]"                                                                        
## [39] "29.Proficiency in using content creation tools [CupCut]"                                                                         
## [40] "29.Proficiency in using content creation tools [Shooting videos]"                                                                
## [41] "29.Proficiency in using content creation tools [Editing Videos]"                                                                 
## [42] "29.Proficiency in using content creation tools [Photography]"                                                                    
## [43] "30.Do you continue to use the skills gained from the program?"                                                                   
## [44] "31.Do you plan to continue developing your content creation skills?"                                                             
## [45] "32.Have you earned any income from your content since completing the program?"                                                   
## [46] "33.If yes, what is your estimated monthly income from content creation in Kenya shillings"                                       
## [47] "34.Which monetisation strategies do you use?"                                                                                    
## [48] "35.If content creation has not been your primary source of income, please specify your main source of income over the past year."
## [49] "36.Do you analyse your digital content creation progress including social media success?"                                        
## [50] "37.How do you currently measure the success or effectiveness of your content?"                                                   
## [51] "38.What are the most significant changes you have  experienced since completing the program?"                                    
## [52] "39.Have you influenced others to pursue digital content creation?"                                                               
## [53] "40.Reflecting on the program, what could be improved to make it better?"                                                         
## [54] "Any additional comments or success stories you would  like to share?"                                                            
## [55] "age"
df1 <- df %>% select (age, '3.Gender', '4.Current location', '5.Highest level of education',
                                  '6.Which of the following digital devices do you have access to ?',
                                  '7. Do you have access to the internet on a regular basis ?',
                                  '8.If you have regular access to the internet , how do you access it?',
                                  '9. Are you a digital content creator?',
                                  '10.What were your expectations before starting the program?')

dim(df1)
## [1] 267   9
#rename the columns

demographics <- df1 %>% rename("gender" ='3.Gender', "education" = '5.Highest level of education',
                                    "county" ='4.Current location',
                                    'device_access' = '6.Which of the following digital devices do you have access to ?',
                                    "internet_regular" = '7. Do you have access to the internet on a regular basis ?',
                                    "frequency_internet"='8.If you have regular access to the internet , how do you access it?',
                                    "contentcreator"='9. Are you a digital content creator?',
                                    "expectations_before"='10.What were your expectations before starting the program?')
colnames(demographics)
## [1] "age"                 "gender"              "county"             
## [4] "education"           "device_access"       "internet_regular"   
## [7] "frequency_internet"  "contentcreator"      "expectations_before"
#gender breakdown

demographics %>% 
  group_by(gender) %>%
  summarise(count=n()) %>%
  pivot_wider(names_from = gender, values_from = count, values_fill = 0)%>%
  adorn_totals("row")%>%
  adorn_percentages("col")
##  Female Male
##     130    1
##   Total    1
#education by gender

datatable(demographics %>% 
  group_by(gender,education) %>%
  summarise(count=n()) %>%
  pivot_wider(names_from = gender, values_from = count, values_fill = 0)%>%
  adorn_totals("col")%>%
  adorn_totals("row"))
## `summarise()` has grouped output by 'gender'. You can override using the
## `.groups` argument.
#replace "1,3,1997" with the mean 

demographics$age[demographics$age %in% c(1,3,1997)] <- 
  as.numeric(round(mean(demographics$age),0))


#replcae "Still in college", "Still in University", "Still in university", "Currently pursuing undergraduate"
#"Currently in college" with "Completed secondary school"

demographics$education[demographics$education %in%
                         c ("Still in college", "Still in University", "Still in university", 
                            "Currently pursuing undergraduate", "Currently in college")] <-
  "Completed secondary school"


colnames(demographics)
## [1] "age"                 "gender"              "county"             
## [4] "education"           "device_access"       "internet_regular"   
## [7] "frequency_internet"  "contentcreator"      "expectations_before"
datatable(demographics %>% 
            group_by(gender,device_access) %>%
            summarise(count=n()) %>%
            pivot_wider(names_from = gender, values_from = count, values_fill = 0)%>%
            adorn_totals("col")%>%
            adorn_totals("row"))
## `summarise()` has grouped output by 'gender'. You can override using the
## `.groups` argument.
#Add new column "device access" atleast a smartphone_access

demographics$smartphoneaccess <- demographics$device_access

#replce with "Smartphoen" entries that have access to a smartphone.

demographics$smartphoneaccess[demographics$smartphoneaccess %in%
                                c(
                                  "Smartphone", "Smartphone, Desktop PC",
                                  "Smartphone, Laptop", "Smartphone, Tablet, Desktop PC, Laptop",
                                  "Smartphone, Tablet, Laptop", 
                                  "Smartphone, Desktop PC, Laptop",
                                  "Smartphone,", "Smartphone, Tablet", "Smartphone, Tablet, Desktop PC",
                                  "Feature phone, I lost my smart phone 2 weeks ago"
                                )] <- "Smartphone"


datatable(demographics %>% 
            group_by(gender,smartphoneaccess) %>%
            summarise(count=n()) %>%
            pivot_wider(names_from = gender, values_from = count, values_fill = 0)%>%
            adorn_totals("col")%>%
            adorn_totals("row"))
## `summarise()` has grouped output by 'gender'. You can override using the
## `.groups` argument.
#access to atleast a smartphone =0.958 or 96% , female 96%. compare to Male access at
#no difference in twems of access to devices between male and female participants 
125/130
## [1] 0.9615385
131/137
## [1] 0.9562044
#internet access 

datatable(demographics %>% 
            group_by(gender,internet_regular) %>%
            summarise(count=n()) %>%
            pivot_wider(names_from = gender, values_from = count, values_fill = 0)%>%
            adorn_totals("col")%>%
            adorn_totals("row"))
## `summarise()` has grouped output by 'gender'. You can override using the
## `.groups` argument.
#regualr access to internet Yes/No 87% have access to the internet on a regular basis
#male access at 90%, female at 82%

#Chi-Square Test of Independence to see if there's an association between gender and access:

table_access <- table(demographics$gender, demographics$internet_regular)

chisq.test(table_access)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  table_access
## X-squared = 3.1769, df = 1, p-value = 0.07469
#HO-there is no significnat diffrence in access to the internet between Men and women
#H1-there is a significant difference in acccess to internt between men and women 
#if P-value < 0.05 , then reject HO

#X-squared = 3.1769, df = 1, p-value = 0.07469

# which is greater than 0.05 hence ther is no association between access to internet and gender 
#meaning there is a smaller difference between gender and internet access


colnames(demographics)
##  [1] "age"                 "gender"              "county"             
##  [4] "education"           "device_access"       "internet_regular"   
##  [7] "frequency_internet"  "contentcreator"      "expectations_before"
## [10] "smartphoneaccess"
table(demographics$gender,demographics$contentcreator)
##         
##           No Yes
##   Female  46  84
##   Male    27 110
datatable(demographics %>% 
            group_by(gender,contentcreator) %>%
            summarise(count=n()) %>%
            pivot_wider(names_from = gender, values_from = count, values_fill = 0)%>%
            adorn_totals("col")%>%
            adorn_totals("row"))
## `summarise()` has grouped output by 'gender'. You can override using the
## `.groups` argument.
#content creation 64% among women, 80% among men

#Chisquare test of association between gender and content creation 

test_table <- table(demographics$gender,demographics$contentcreator)

chisq.test(test_table)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  test_table
## X-squared = 7.4816, df = 1, p-value = 0.006233
#There is a statistically significant association between gender and content creation participation.
#This means that content creation levels differ significantly between men and women.
#X-squared = 7.4816, df = 1, p-value = 0.006233

#Skills

unique(demographics$location)
## Warning: Unknown or uninitialised column: `location`.
## NULL
demographics$location<-demographics$county

demographics$location[demographics$location %in%
                        c("Kitui","Kisii","Kakamega","Tharaka-Nithi","Laikipia","Elgeyo/Marakwet",
                          "Kiambu","Migori","Bungoma","Murang'a", "Kilifi","Vihiga",
                          "Baringo","Siaya","Kajiado", "Makueni", "Kirinyaga","Nyeri","Embu","Samburu",
                          "Homa Bay","Wajir","Busia","Uasin Gishu","Kwale","Isiolo","Meru","Nyandarua",
                          "Machakos","Trans Nzoia","West Pokot"
                          
                        )] <- "Rural"

demographics$location[demographics$location %in%
                        c(
                          "Nairobi","Kisumu","Nakuru","Mombasa"
                        )] <- "urban"

unique(demographics$location)
## [1] "Rural" "urban"
location_test <- table(demographics$location, demographics$contentcreator)

chisq.test(location_test)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  location_test
## X-squared = 2.0106, df = 1, p-value = 0.1562
#There is no statistically significant association between rural/urban location and content creation.
#This means that based on the data, rural and urban participants engage in content creation 
#at similar levels, with no strong evidence of a difference.


colnames(demographics)
##  [1] "age"                 "gender"              "county"             
##  [4] "education"           "device_access"       "internet_regular"   
##  [7] "frequency_internet"  "contentcreator"      "expectations_before"
## [10] "smartphoneaccess"    "location"
dim(demographics)
## [1] 267  11
#___________________________________________________________________________________________________


colnames(df)
##  [1] "2.Date  birth"                                                                                                                   
##  [2] "3.Gender"                                                                                                                        
##  [3] "4.Current location"                                                                                                              
##  [4] "5.Highest level of education"                                                                                                    
##  [5] "6.Which of the following digital devices do you have access to ?"                                                                
##  [6] "7. Do you have access to the internet on a regular basis ?"                                                                      
##  [7] "8.If you have regular access to the internet , how do you access it?"                                                            
##  [8] "9. Are you a digital content creator?"                                                                                           
##  [9] "10.What were your expectations before starting the program?"                                                                     
## [10] "11.Before the program, how would you rate your digital content creation skills?"                                                 
## [11] "12. How satisfied were you with the training program overall?"                                                                   
## [12] "13. What did you like most about the program?"                                                                                   
## [13] "14. Do you feel the program addressed the challenges you faced in creating digital content?"                                     
## [14] "15.After the program, how would you rate your digital content creation skills?"                                                  
## [15] "16.On a scale of 1–5, how relevant was the program content to your needs?"                                                       
## [16] "17.Please indicate which of the following skills you gained or improved during the program (select all that apply):"             
## [17] "18. Were you able to apply these skills after the program?"                                                                      
## [18] "19.Do you have access to tools and platforms to sustain your digital content journey?"                                           
## [19] "20.Please indicate the tools/applications/software that you are currently using for content creation"                            
## [20] "21.If yes, give examples of how you applied these tools."                                                                        
## [21] "22.Please indicate the social media platforms you are currently using to share your content."                                    
## [22] "23. On a scale of 1 to 5, how confident do you feel creating content on your own?"                                               
## [23] "24.How frequently do you create content?"                                                                                        
## [24] "25.How frequently do you publish content?"                                                                                       
## [25] "26.How many hours do you spend working in content creation in a normal week?"                                                    
## [26] "27.What challenges have you faced in the past 1 year in producing and publishing digital content"                                
## [27] "28.In a scale of 1-5, please rate your skills in the following areas.  [Videography]"                                            
## [28] "28.In a scale of 1-5, please rate your skills in the following areas.  [Photography]"                                            
## [29] "28.In a scale of 1-5, please rate your skills in the following areas.  [Graphic design]"                                         
## [30] "28.In a scale of 1-5, please rate your skills in the following areas.  [Social media management]"                                
## [31] "28.In a scale of 1-5, please rate your skills in the following areas.  [SEO and analytics]"                                      
## [32] "29.Proficiency in using content creation tools [Canva]"                                                                          
## [33] "29.Proficiency in using content creation tools [Adobe photoshop]"                                                                
## [34] "29.Proficiency in using content creation tools [Search Engine optimization]"                                                     
## [35] "29.Proficiency in using content creation tools [Social media marketing]"                                                         
## [36] "29.Proficiency in using content creation tools [Google Analytics]"                                                               
## [37] "29.Proficiency in using content creation tools [Personal branding]"                                                              
## [38] "29.Proficiency in using content creation tools [ChatGPT]"                                                                        
## [39] "29.Proficiency in using content creation tools [CupCut]"                                                                         
## [40] "29.Proficiency in using content creation tools [Shooting videos]"                                                                
## [41] "29.Proficiency in using content creation tools [Editing Videos]"                                                                 
## [42] "29.Proficiency in using content creation tools [Photography]"                                                                    
## [43] "30.Do you continue to use the skills gained from the program?"                                                                   
## [44] "31.Do you plan to continue developing your content creation skills?"                                                             
## [45] "32.Have you earned any income from your content since completing the program?"                                                   
## [46] "33.If yes, what is your estimated monthly income from content creation in Kenya shillings"                                       
## [47] "34.Which monetisation strategies do you use?"                                                                                    
## [48] "35.If content creation has not been your primary source of income, please specify your main source of income over the past year."
## [49] "36.Do you analyse your digital content creation progress including social media success?"                                        
## [50] "37.How do you currently measure the success or effectiveness of your content?"                                                   
## [51] "38.What are the most significant changes you have  experienced since completing the program?"                                    
## [52] "39.Have you influenced others to pursue digital content creation?"                                                               
## [53] "40.Reflecting on the program, what could be improved to make it better?"                                                         
## [54] "Any additional comments or success stories you would  like to share?"                                                            
## [55] "age"
dfx<-df%>% select("11.Before the program, how would you rate your digital content creation skills?",
                  "15.After the program, how would you rate your digital content creation skills?",
                  "12. How satisfied were you with the training program overall?",
                  "14. Do you feel the program addressed the challenges you faced in creating digital content?",
                  "16.On a scale of 1–5, how relevant was the program content to your needs?",
                  "17.Please indicate which of the following skills you gained or improved during the program (select all that apply):",
                  "18. Were you able to apply these skills after the program?",
                  "19.Do you have access to tools and platforms to sustain your digital content journey?",
                  "20.Please indicate the tools/applications/software that you are currently using for content creation",
                  "22.Please indicate the social media platforms you are currently using to share your content.",
                  "23. On a scale of 1 to 5, how confident do you feel creating content on your own?",
                  "24.How frequently do you create content?",
                  "25.How frequently do you publish content?",
                  "28.In a scale of 1-5, please rate your skills in the following areas.  [Videography]",
                  "28.In a scale of 1-5, please rate your skills in the following areas.  [Photography]",
                  "28.In a scale of 1-5, please rate your skills in the following areas.  [Graphic design]",
                  "28.In a scale of 1-5, please rate your skills in the following areas.  [Social media management]",
                  "28.In a scale of 1-5, please rate your skills in the following areas.  [SEO and analytics]",
                  "32.Have you earned any income from your content since completing the program?",
                  "33.If yes, what is your estimated monthly income from content creation in Kenya shillings",
                  "34.Which monetisation strategies do you use?")%>%
  rename(
   "skillsBefore" ="11.Before the program, how would you rate your digital content creation skills?",
   "skillsAfter"="15.After the program, how would you rate your digital content creation skills?",
   "satisfaction"="12. How satisfied were you with the training program overall?",
  "didprogramaddressChal"="14. Do you feel the program addressed the challenges you faced in creating digital content?",
  "relevanceNeeds"="16.On a scale of 1–5, how relevant was the program content to your needs?",
   "GainedImprovedSkills"="17.Please indicate which of the following skills you gained or improved during the program (select all that apply):",
   "SkillsApplication"="18. Were you able to apply these skills after the program?",
  "toolsAcess"="19.Do you have access to tools and platforms to sustain your digital content journey?",
  "softwareToolsUsed"="20.Please indicate the tools/applications/software that you are currently using for content creation",
  "SocialMediaPlatform"="22.Please indicate the social media platforms you are currently using to share your content.",
  "confidenceContent"="23. On a scale of 1 to 5, how confident do you feel creating content on your own?",
  "CreateFreq"="24.How frequently do you create content?",
  "PublishFreq"="25.How frequently do you publish content?",
  "VideographySkill"="28.In a scale of 1-5, please rate your skills in the following areas.  [Videography]",
 "PhotographySkill"="28.In a scale of 1-5, please rate your skills in the following areas.  [Photography]",
 "GraphicDesignSkill"="28.In a scale of 1-5, please rate your skills in the following areas.  [Graphic design]",
 "SocialMediaMgtSkill"="28.In a scale of 1-5, please rate your skills in the following areas.  [Social media management]",
   "SEOAnalytics"="28.In a scale of 1-5, please rate your skills in the following areas.  [SEO and analytics]",
 "EarnedYesNo"="32.Have you earned any income from your content since completing the program?",
 "AverageIncome"="33.If yes, what is your estimated monthly income from content creation in Kenya shillings",
 "MonetizationStrategy"="34.Which monetisation strategies do you use?"
  )
##########################################################################################################################

# to text analyse dfx$`13. What did you like most about the program?`

#merged skills satsisfaction, relevance with demographic dataset

SkillsData <- bind_cols(demographics, dfx)

table(SkillsData$skillsBefore)
## 
##     Advanced        Basic Intermediate         None 
##            4          171           13           78
table(SkillsData$skillsAfter)
## 
##     Advanced        Basic Intermediate 
##           66           42          159
SkillsBefore<- c(Advanced=4,Intermediate=13, Basic =171, None =78)
sum(SkillsBefore)
## [1] 266
SkillsAfter<- c(Advanced=66,Intermediate=159, Basic =42, None =0)
sum(SkillsBefore)
## [1] 266
round(prop.table(SkillsBefore)*100,1)
##     Advanced Intermediate        Basic         None 
##          1.5          4.9         64.3         29.3
round(prop.table(SkillsAfter)*100, 1)
##     Advanced Intermediate        Basic         None 
##         24.7         59.6         15.7          0.0
#Skills before and after graphical analysis.

par(mfrow=c(1,2))

barplot(SkillsBefore, main = "Skills before training", col = "skyblue", ylab = "count")
barplot(SkillsAfter, main = "Skills after training", col = "grey", ylab = "count" )

#The training program had a strong positive impact on participants' digital/content creation skills.
#There was a marked shift from low or no skills to intermediate and advanced levels, 
#and zero participants remained without any digital skills after the training. 
#The Net gain in higher-level skills (Advanced + Intermediate):
# From 7% (2% + 5%) → 85% (25% + 60%) = +78 percentage points and Net reduction in low/no skills (Basic + None):
# From 93% (64% + 29%) → 16% = −77 percentage points
#The percentage at basic level decreased from 64% to 16%, 
#likely due to many participants moving up to intermediate and advanced levels.
#The proportion of participants with no skills at all dropped from 29% to 0%, 
#indicating full coverage of at least basic digital skills post-training.

datatable(data.frame(
  "Skills level" = c("Advance", "intermediate", "Basic", "No skills"),
  "Before Training (%)" = c(2, 5, 64, 29),
  "After Training (%)" = c(25, 60, 16, 0),
  "Change (Percentage Points)" = c(+23, +55, -48, -29)
           ))
###########################################################################################################################

colnames(SkillsData)
##  [1] "age"                   "gender"                "county"               
##  [4] "education"             "device_access"         "internet_regular"     
##  [7] "frequency_internet"    "contentcreator"        "expectations_before"  
## [10] "smartphoneaccess"      "location"              "skillsBefore"         
## [13] "skillsAfter"           "satisfaction"          "didprogramaddressChal"
## [16] "relevanceNeeds"        "GainedImprovedSkills"  "SkillsApplication"    
## [19] "toolsAcess"            "softwareToolsUsed"     "SocialMediaPlatform"  
## [22] "confidenceContent"     "CreateFreq"            "PublishFreq"          
## [25] "VideographySkill"      "PhotographySkill"      "GraphicDesignSkill"   
## [28] "SocialMediaMgtSkill"   "SEOAnalytics"          "EarnedYesNo"          
## [31] "AverageIncome"         "MonetizationStrategy"
unique(SkillsData$SkillsApplication)
## [1] "Yes" "No"
table(SkillsData$gender, SkillsData$SkillsApplication)
##         
##           No Yes
##   Female  21 109
##   Male    11 126
data.frame(table(SkillsData$SkillsApplication))
##   Var1 Freq
## 1   No   32
## 2  Yes  235
# Create the data frame
applicationskills <- data.frame(
  Response = c("No", "Yes"),
  Count = c(32, 235)
)

# Add percentage column for labeling
applicationskills$Percentage <- round((applicationskills$Count / sum(applicationskills$Count)) * 100, 1)

# Plot using ggplot2
ggplot(applicationskills, aes(x = Response, y = Count, fill = Response)) +
  geom_bar(stat = "identity", width = 0.6, show.legend = FALSE) +
  geom_text(aes(label = paste0(Percentage, "%")), vjust = -0.5, size = 5) +
  scale_fill_manual(values = c("No" = "#F8766D", "Yes" = "#00BFC4")) +
  labs(
    title = "Application of Skills After Training",
    x = "Applied Skills",
    y = "Number of Participants"
  ) +
  theme_minimal(base_size = 14) +
  theme(
    plot.title = element_text(hjust = 0.5, face = "bold"),
    axis.title.y = element_text(margin = margin(r = 10)),
    axis.title.x = element_text(margin = margin(t = 10))
  )

#Skills by gender. women= 109/130, 83% , Men at 92%
#X-squared = 3.4395, df = 1, p-value = 0.06366

#TA chi-square test was conducted to assess the relationship between gender and the 
#application of skills. The result was not statistically significant at the 5% level, X²(1, N = [267]) = 3.44, p = 0.064.
#This suggests that there is no strong evidence of a gender-based difference in applying the skills after training, 
# although a weak trend may exist.

skill_gender <-table(SkillsData$gender, SkillsData$SkillsApplication)
chisq.test(skill_gender)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  skill_gender
## X-squared = 3.4395, df = 1, p-value = 0.06366
############################################################################################################################

colnames(SkillsData)
##  [1] "age"                   "gender"                "county"               
##  [4] "education"             "device_access"         "internet_regular"     
##  [7] "frequency_internet"    "contentcreator"        "expectations_before"  
## [10] "smartphoneaccess"      "location"              "skillsBefore"         
## [13] "skillsAfter"           "satisfaction"          "didprogramaddressChal"
## [16] "relevanceNeeds"        "GainedImprovedSkills"  "SkillsApplication"    
## [19] "toolsAcess"            "softwareToolsUsed"     "SocialMediaPlatform"  
## [22] "confidenceContent"     "CreateFreq"            "PublishFreq"          
## [25] "VideographySkill"      "PhotographySkill"      "GraphicDesignSkill"   
## [28] "SocialMediaMgtSkill"   "SEOAnalytics"          "EarnedYesNo"          
## [31] "AverageIncome"         "MonetizationStrategy"
table(SkillsData$satisfaction)
## 
##      Dissatisfied           Neutral         Satisfied Very dissatisfied 
##                 5                49               129                 4 
##    Very satisfied 
##                80
#12.How satisfied were you with the training program overall?`

SkillsData%>%
  group_by(gender,satisfaction)%>%
  summarise(count = n())%>%
  pivot_wider(names_from = gender, values_from = count, values_fill = 0)%>%
  adorn_totals("row")%>%
  adorn_totals("col")
## `summarise()` has grouped output by 'gender'. You can override using the
## `.groups` argument.
##       satisfaction Female Male Total
##       Dissatisfied      1    4     5
##            Neutral     29   20    49
##          Satisfied     60   69   129
##     Very satisfied     40   40    80
##  Very dissatisfied      0    4     4
##              Total    130  137   267
#The majority of participants were satisfied with the program, with 78% rating it 
#as either "Satisfied" or "Very Satisfied". Only 3% reported dissatisfaction. 
#This indicates a high level of program satisfaction, suggesting that the training met 
#or exceeded expectations for most participants.

#Address the needs 95% 

table(SkillsData$didprogramaddressChal)
## 
##  No Yes 
##  13 254
#Relenat to needs 80%

#data$`16.On a scale of 1–5, how relevant was the program content to your needs?`
###################################################################################################
str(SkillsData$relevanceNeeds)
##  num [1:267] 3 3 5 5 4 5 4 4 5 5 ...
(mean(SkillsData$relevanceNeeds)/5)*100
## [1] 80
satisfaction <- c("Very Dissatisfied" = 4,
                  "Dissatisfied" = 5,
                  "Neutral" = 49,
                  "Satisfied" = 129,
                  "Very Satisfied" = 80)

percentages <- round(prop.table(satisfaction) * 100, 1)

library(ggplot2)

# Create dataframe
df <- data.frame(
  Satisfaction = names(satisfaction),
  Count = as.vector(satisfaction),
  Percent = percentages
)

# Reorder for natural satisfaction order
df$Satisfaction <- factor(df$Satisfaction, 
                          levels = c("Very Dissatisfied", "Dissatisfied", "Neutral", "Satisfied", "Very Satisfied"))

# Plot
ggplot(df, aes(x = Satisfaction, y = Count, fill = Satisfaction)) +
  geom_bar(stat = "identity", width = 0.6) +
  geom_text(aes(label = paste0(Percent, "%")), vjust = -0.5, size = 4.5) +
  scale_fill_brewer(palette = "RdYlGn") +
  labs(
    title = "Program Satisfaction Levels after training",
    y = "Number of Respondents",
    x = "Satisfaction Level"
  ) +
  theme_minimal(base_size = 14) +
  theme(plot.title = element_text(hjust = 0.5, face = "bold"))

###########################################################################################################################

chisq.test(table(SkillsData$smartphoneaccess, SkillsData$SkillsApplication))
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  table(SkillsData$smartphoneaccess, SkillsData$SkillsApplication)
## X-squared = 7.8427, df = 2, p-value = 0.01981
#There is a statistically significant association between smartphone access and application of skills.
#In other words, the likelihood of applying skills varies depending on smartphone access status.
#Participants with better or personal access to smartphones are more likely to apply the skills they learned.
#Conversely, those with limited or no access to smartphones may be less able to apply those skills.

#A chi-square test of independence revealed a significant association between smartphone access and 
#skills application, X²(2, N = [insert sample size]) = 7.84, p = 0.020. This indicates that the likelihood
#of applying learned skills differs by level of smartphone access, suggesting access to smartphones may 
#play a key role in practical skill utilization.

table_data <- table(SkillsData$smartphoneaccess, SkillsData$SkillsApplication)

mosaicplot(table_data, main = "Skills Application by Smartphone Access",
           color = TRUE, las = 1)

library(ggplot2)

# Convert table to data frame
dfplot <- as.data.frame(table_data)
colnames(dfplot) <- c("SmartphoneAccess", "SkillsApplication", "Count")

# Plot
ggplot(dfplot, aes(x = SmartphoneAccess, y = Count, fill = SkillsApplication)) +
  geom_bar(stat = "identity", position = "fill") +  # Use "fill" to show proportions
  scale_y_continuous(labels = scales::percent) +
  labs(title = "Skills Application by Smartphone Access",
       x = "Smartphone Access", y = "Proportion") +
  theme_minimal() +
  scale_fill_brewer(palette = "Set2")

#Chi-square statistic

#Degrees of freedom

#Cramér's V, which measures the strength of the association.



library(vcd)  # or rcompanion
## Warning: package 'vcd' was built under R version 4.3.3
## Loading required package: grid
assocstats(table_data)
##                     X^2 df P(> X^2)
## Likelihood Ratio 5.5725  2 0.061653
## Pearson          7.8427  2 0.019815
## 
## Phi-Coefficient   : NA 
## Contingency Coeff.: 0.169 
## Cramer's V        : 0.171
#Cramer's V : 0.171 ##Strong association

colnames(SkillsData)
##  [1] "age"                   "gender"                "county"               
##  [4] "education"             "device_access"         "internet_regular"     
##  [7] "frequency_internet"    "contentcreator"        "expectations_before"  
## [10] "smartphoneaccess"      "location"              "skillsBefore"         
## [13] "skillsAfter"           "satisfaction"          "didprogramaddressChal"
## [16] "relevanceNeeds"        "GainedImprovedSkills"  "SkillsApplication"    
## [19] "toolsAcess"            "softwareToolsUsed"     "SocialMediaPlatform"  
## [22] "confidenceContent"     "CreateFreq"            "PublishFreq"          
## [25] "VideographySkill"      "PhotographySkill"      "GraphicDesignSkill"   
## [28] "SocialMediaMgtSkill"   "SEOAnalytics"          "EarnedYesNo"          
## [31] "AverageIncome"         "MonetizationStrategy"
#Skills greatly increased to text analyse

#Access to tools- "19.Do you have access to tools and platforms to sustain your digital content journey?" 
#84% have access to tools to support their content creation journes compared to 33% at baseline

colnames(df)
## [1] "Satisfaction" "Count"        "Percent"
table(SkillsData$toolsAcess)
## 
##  No Yes 
##  39 225
225/267
## [1] 0.8426966
#"20.Please indicate the tools/applications/software that you are currently using for content creation"
#text analysis

#Confidence to create content 74.45693 % compared to 52% at baseline
(mean(SkillsData$confidenceContent)/5)*100
## [1] 74.45693
unique(SkillsData$CreateFreq)
## [1] "Rarely"                "Weekly"                "Less than once a week"
## [4] "Daily"                 "Several times a week"
table(SkillsData$CreateFreq)
## 
##                 Daily Less than once a week                Rarely 
##                    27                    12                    83 
##  Several times a week                Weekly 
##                    81                    64
table(SkillsData$PublishFreq)
## 
##                 Daily Less than once a week                Rarely 
##                    39                    15                   101 
##  Several times a week                Weekly 
##                    56                    56
#Create dataframe

ContentCreation <-data.frame(
  frequency = c("Weekly","Rarely","Daily","Less than once a week","Several times a week"),
  CreateContent = c(27,12,83,81,64),
  PublishContent = c(39,15,101,56,56)
)
##################################################################################################
#######"27.What challenges have you faced in the past 1 year in producing and publishing digital content" ########

###################################################################################################

table(SkillsData$VideographySkill)
## 
##       I was not taught this  Skill has improved greatly 
##                          17                          87 
##   Skill has stayed the same Skills has improved slighly 
##                          27                         116
table(SkillsData$PhotographySkill)
## 
##       I was not taught this  Skill has improved greatly 
##                          13                         103 
##   Skill has stayed the same Skills has improved slighly 
##                          26                         101
table(SkillsData$GraphicDesignSkill)
## 
##       I was not taught this  Skill has improved greatly 
##                          36                          79 
##   Skill has stayed the same Skills has improved slighly 
##                          44                          84
table(SkillsData$SocialMediaMgtSkill)
## 
##       I was not taught this  Skill has improved greatly 
##                          27                          75 
##   Skill has stayed the same Skills has improved slighly 
##                          41                          99
table(SkillsData$SEOAnalytics)
## 
##       I was not taught this  Skill has improved greatly 
##                          55                          37 
##   Skill has stayed the same Skills has improved slighly 
##                          50                         101
SkillsChangeData<-data.frame(
  SkillLevel=c("I was not taught this","Skill has improved greatly",
               "Skill has stayed the same", "Skills has improved slightly"),
  VideoGraphy=c(17,87,27,116),
  PhotoGraphy=c(13,103,26,101),
  GraphicsDesign=c(36,79,44,84),
  SocialMedia=c(27,75,41,99),
  SEO_Analysis=c(55,37,50,101)
)

long_SkillsChange <-pivot_longer(
  SkillsChangeData,
  cols = c(VideoGraphy,PhotoGraphy,GraphicsDesign,SocialMedia,SEO_Analysis),
  names_to = "Skills",
  values_to = "Count"
  
)


########################################################################################

#Sustainability#
#"31.Do you plan to continue developing your content creation skills?"
#"30.Do you continue to use the skills gained from the program?"#
#"39.Have you influenced others to pursue digital content creation?" 









###########################################################################################

###### Monetization #############################################

#"32.Have you earned any income from your content since completing the program?"
#"33.If yes, what is your estimated monthly income from content creation in Kenya shillings" 
#"34.Which monetisation strategies do you use?"

table(SkillsData$EarnedYesNo, SkillsData$gender)
##      
##       Female Male
##   No     103   90
##   Yes     27   47
earndata <-
  data.frame(
  DoYouEarn = c("No", "Yes"),
  Female = c(103,27),
  Men = c(90,47)
  )


prop.table(earndata$Female)
## [1] 0.7923077 0.2076923
prop.table(earndata$Men)
## [1] 0.6569343 0.3430657
#28% of partcicpants reported to be earning from didgital content creation compared to 11% at baseline
#among these , 21% of the women and 34% of the men earn 

#Association between Gender and income/ monetization

income_test<-table(SkillsData$EarnedYesNo, SkillsData$gender)

mosaicplot(income_test, main = "Content monetization by gender")

#Cramér's V, which measures the strength of the association.

library(vcd)

assocstats(income_test)
##                     X^2 df P(> X^2)
## Likelihood Ratio 6.1660  1 0.013023
## Pearson          6.1017  1 0.013505
## 
## Phi-Coefficient   : 0.151 
## Contingency Coeff.: 0.149 
## Cramer's V        : 0.151
#Cramer's V : 0.151 modertae association between income and gender
#and X-squared = 5.4447, df = 1, p-value = 0.01963 which further suggests that there is 
# an association between incomes and gender with men likely to monetize than women.

#crammer V; 0.11 – 0.30- modertae association
#crammer V; 0.31 – 0.50- Strong association
#crammer V; 0.10 or less-weak association
#crammer V; above 0.5 very strong association

chisq.test(income_test)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  income_test
## X-squared = 5.4447, df = 1, p-value = 0.01963
####Income by location####

locatio_Earning<-table(SkillsData$location, SkillsData$EarnedYesNo)

chisq.test(locatio_Earning)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  locatio_Earning
## X-squared = 1.0542e-30, df = 1, p-value = 1
#X-squared = 1.0542e-30, df = 1, p-value = 1#
#A chi-square test of independence showed no significant association between rural/urban location and income earned, χ²(1, N = [insert sample size]) ≈ 0, p = 1.
#This suggests that the income distribution does not vary by location in this sample.

#####Average income########

summary(SkillsData$AverageIncome)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##     250    2625    5000    7766    9750   60000     213
mean(SkillsData$AverageIncome, na.rm = T)
## [1] 7765.556
table(SkillsData$AverageIncome, SkillsData$gender)
##        
##         Female Male
##   250        0    1
##   500        1    0
##   950        1    0
##   1000       3    0
##   1500       0    4
##   2000       2    1
##   2500       1    0
##   3000       0    2
##   4000       2    1
##   5000       3    9
##   6000       0    2
##   7000       2    1
##   7140       0    1
##   8000       0    1
##   9000       1    1
##   10000      2    4
##   13000      0    1
##   15000      0    2
##   18000      1    0
##   20000      0    1
##   25000      1    0
##   30000      0    1
##   60000      0    1
SkillsData %>%
  group_by(gender)%>%
  summarise(AvIncome = mean(AverageIncome, na.rm = TRUE))
## # A tibble: 2 × 2
##   gender AvIncome
##   <chr>     <dbl>
## 1 Female    5998.
## 2 Male      8806.
#Average income is 7766Kes with incomes among women at 5998 compared to male 8806
 

#################################################################################

################ Impact ################################################

#"38.What are the most significant changes you have experienced since completing the program?"

#################################################################################

##########################################CONFIDENCE##########################################

mean(SkillsData$confidenceContent)
## [1] 3.722846
table(SkillsData$gender,SkillsData$confidenceContent)
##         
##           1  2  3  4  5
##   Female  8  7 39 43 33
##   Male    0  5 49 54 29
SkillsData %>% 
  group_by(gender)%>%
  summarise(AvConf=mean(confidenceContent, na.rm = TRUE))
## # A tibble: 2 × 2
##   gender AvConf
##   <chr>   <dbl>
## 1 Female   3.66
## 2 Male     3.78
confidence_table <- data.frame(
  gender = c("Female", "Male", "OveralScore"),
  rate = c(3.66, 3.78, 3.72)
)

confidence<-confidence_table %>% mutate (Score = (rate/5)*100)

confidence_test<-table(SkillsData$gender,SkillsData$confidenceContent)


chisq.test(confidence_test)
## Warning in stats::chisq.test(x, y, ...): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  confidence_test
## X-squared = 10.799, df = 4, p-value = 0.02892

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.