library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ forcats   1.0.0     ✔ readr     2.1.4
## ✔ ggplot2   3.4.1     ✔ stringr   1.5.0
## ✔ lubridate 1.9.2     ✔ tibble    3.2.1
## ✔ purrr     1.0.1     ✔ tidyr     1.3.0
## ── 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(ggplot2)
library(rmarkdown)

setwd("C:/Users/srish/Downloads")
#WVS7 2022 India survey dataset 
df<- read.csv("V5IND.csv")
names(df)
##   [1] "version..Version.of.Data.File"                                                                                                                 
##   [2] "doi..Digital.Object.Identifier"                                                                                                                
##   [3] "A_YEAR..Year.of.survey"                                                                                                                        
##   [4] "B_COUNTRY..ISO.3166.1.numeric.country.code"                                                                                                    
##   [5] "B_COUNTRY_ALPHA..ISO.3166.1.alpha.3.country.code"                                                                                              
##   [6] "C_COW_NUM..CoW.country.code.numeric"                                                                                                           
##   [7] "C_COW_ALPHA..CoW.country.code.alpha"                                                                                                           
##   [8] "D_INTERVIEW..Interview.ID"                                                                                                                     
##   [9] "J_INTDATE..Date.of.interview"                                                                                                                  
##  [10] "FW_START..Year.month.of.start.fieldwork"                                                                                                       
##  [11] "FW_END..Year.month.of.end.fieldwork"                                                                                                           
##  [12] "K_TIME_START..Start.time.of.the.interview..HH.MM."                                                                                             
##  [13] "K_TIME_END..End.time.of.the.interview..HH.MM."                                                                                                 
##  [14] "K_DURATION..Total.length.of.interview..minutes."                                                                                               
##  [15] "Q_MODE..Mode.of.data.collection"                                                                                                               
##  [16] "N_REGION_ISO..Region.ISO.3166.2"                                                                                                               
##  [17] "G_TOWNSIZE..Settlement.size_8.groups"                                                                                                          
##  [18] "G_TOWNSIZE2..Settlement.size_5.groups"                                                                                                         
##  [19] "H_SETTLEMENT..Settlement.type"                                                                                                                 
##  [20] "H_URBRURAL..Urban.Rural"                                                                                                                       
##  [21] "I_PSU..Primary.Sampling.Unit.ID"                                                                                                               
##  [22] "O1_LONGITUDE..Geographical.Coordinates...Longitude"                                                                                            
##  [23] "O2_LATITUDE..Geographical.Coordinates...Latitude"                                                                                              
##  [24] "S_INTLANGUAGE..Language.in.which.interview.was.conducted"                                                                                      
##  [25] "LNGE_ISO..Language.in.which.interview.was.conducted...ISO.639.1.Alpha.2.digit."                                                                
##  [26] "E_RESPINT..Respondent.interested.during.the.interview"                                                                                         
##  [27] "F_INTPRIVACY..Interview.privacy"                                                                                                               
##  [28] "E1_LITERACY..Respondent.s.literacy"                                                                                                            
##  [29] "W_WEIGHT..Weight"                                                                                                                              
##  [30] "S018..Equilibration.weight.1000"                                                                                                               
##  [31] "PWGHT..Population.size.weight"                                                                                                                 
##  [32] "Q1..Important.in.life..Family"                                                                                                                 
##  [33] "Q2..Important.in.life..Friends"                                                                                                                
##  [34] "Q3..Important.in.life..Leisure.time"                                                                                                           
##  [35] "Q4..Important.in.life..Politics"                                                                                                               
##  [36] "Q5..Important.in.life..Work"                                                                                                                   
##  [37] "Q6..Important.in.life..Religion"                                                                                                               
##  [38] "Q7..Important.child.qualities..good.manners"                                                                                                   
##  [39] "Q8..Important.child.qualities..independence"                                                                                                   
##  [40] "Q9..Important.child.qualities..hard.work"                                                                                                      
##  [41] "Q10..Important.child.qualities..feeling.of.responsibility"                                                                                     
##  [42] "Q11..Important.child.qualities..imagination"                                                                                                   
##  [43] "Q12..Important.child.qualities..tolerance.and.respect.for.other.people"                                                                        
##  [44] "Q13..Important.child.qualities..thrift.saving.money.and.things"                                                                                
##  [45] "Q14..Important.child.qualities..determination.perseverance"                                                                                    
##  [46] "Q15..Important.child.qualities..religious.faith"                                                                                               
##  [47] "Q16..Important.child.qualities..unselfishness"                                                                                                 
##  [48] "Q17..Important.child.qualities..obedience"                                                                                                     
##  [49] "Q18..Neighbors..Drug.addicts"                                                                                                                  
##  [50] "Q19..Neighbors..People.of.a.different.race"                                                                                                    
##  [51] "Q20..Neighbors..People.who.have.AIDS"                                                                                                          
##  [52] "Q21..Neighbors..Immigrants.foreign.workers"                                                                                                    
##  [53] "Q22..Neighbors..Homosexuals"                                                                                                                   
##  [54] "Q23..Neighbors..People.of.a.different.religion"                                                                                                
##  [55] "Q24..Neighbors..Heavy.drinkers"                                                                                                                
##  [56] "Q25..Neighbors..Unmarried.couples.living.together"                                                                                             
##  [57] "Q26..Neighbors..People.who.speak.a.different.language"                                                                                         
##  [58] "Q27..One.of.main.goals.in.life.has.been.to.make.my.parents.proud"                                                                              
##  [59] "Q28..Pre.school.child.suffers.with.working.mother"                                                                                             
##  [60] "Q29..Men.make.better.political.leaders.than.women.do"                                                                                          
##  [61] "Q30..University.is.more.important.for.a.boy.than.for.a.girl"                                                                                   
##  [62] "Q31..Men.make.better.business.executives.than.women.do"                                                                                        
##  [63] "Q32..Being.a.housewife.just.as.fulfilling"                                                                                                     
##  [64] "Q33..Jobs.scarce..Men.should.have.more.right.to.a.job.than.women"                                                                              
##  [65] "Q33_3..Jobs.scarce..Men.should.have.more.right.to.a.job.than.women..3.point.scale."                                                            
##  [66] "Q34..Jobs.scarce..Employers.should.give.priority.to..nation..people.than.immigrants"                                                           
##  [67] "Q34_3..Jobs.scarce..Employers.should.give.priority.to..nation..people.than.immigrants..3.point.scale."                                         
##  [68] "Q35..Problem.if.women.have.more.income.than.husband"                                                                                           
##  [69] "Q35_3..Problem.if.women.have.more.income.than.husband..3.point.scale."                                                                         
##  [70] "Q36..Homosexual.couples.are.as.good.parents.as.other.couples"                                                                                  
##  [71] "Q37..Duty.towards.society.to.have.children"                                                                                                    
##  [72] "Q38..It.is.children.duty.to.take.care.of.ill.parent"                                                                                           
##  [73] "Q39..People.who.don.t.work.turn.lazy"                                                                                                          
##  [74] "Q40..Work.is.a.duty.towards.society"                                                                                                           
##  [75] "Q41..Work.should..always.come.first.even.if.it.means.less.spare.time"                                                                          
##  [76] "Q42..Basic.kinds.of.attitudes.concerning.society"                                                                                              
##  [77] "Q43..Future.changes..Less.importance.placed.on.work"                                                                                           
##  [78] "Q44..Future.changes..More.emphasis.on.technology"                                                                                              
##  [79] "Q45..Future.changes..Greater.respect.for.authority"                                                                                            
##  [80] "Q46..Feeling.of.happiness"                                                                                                                     
##  [81] "Q47..State.of.health..subjective."                                                                                                             
##  [82] "Q48..How.much.freedom.of.choice.and.control"                                                                                                   
##  [83] "Q49..Satisfaction.with.your.life"                                                                                                              
##  [84] "Q50..Satisfaction.with.financial.situation.of.household"                                                                                       
##  [85] "Q51..Frequency.you.family..last.12.month...Gone.without.enough.food.to.eat"                                                                    
##  [86] "Q52..Frequency.you.family..last.12.month...Felt.unsafe.from.crime.in.your.own.home"                                                            
##  [87] "Q53..Frequency.you.family..last.12.month...Gone.without.needed.medicine.or.treatment.that.you.needed"                                          
##  [88] "Q54..Frequency.you.family..last.12.month...Gone.without.a.cash.income"                                                                         
##  [89] "Q55..In.the.last.12.month..how.often.have.you.or.your.family..Gone.without.a.safe.shelter.over.your.head"                                      
##  [90] "Q56..Standard.of.living.comparing.with.your.parents"                                                                                           
##  [91] "Q57..Most.people.can.be.trusted"                                                                                                               
##  [92] "Q58..Trust..Your.family"                                                                                                                       
##  [93] "Q59..Trust..Your.neighborhood"                                                                                                                 
##  [94] "Q60..Trust..People.you.know.personally"                                                                                                        
##  [95] "Q61..Trust..People.you.meet.for.the.first.time"                                                                                                
##  [96] "Q62..Trust..People.of.another.religion"                                                                                                        
##  [97] "Q63..Trust..People.of.another.nationality"                                                                                                     
##  [98] "Q64..Confidence..Churches"                                                                                                                     
##  [99] "Q65..Confidence..Armed.Forces"                                                                                                                 
## [100] "Q66..Confidence..The.Press"                                                                                                                    
## [101] "Q67..Confidence..Television"                                                                                                                   
## [102] "Q68..Confidence..Labor.Unions"                                                                                                                 
## [103] "Q69..Confidence..The.Police"                                                                                                                   
## [104] "Q70..Confidence..Justice.System.Courts"                                                                                                        
## [105] "Q71..Confidence..The.Government"                                                                                                               
## [106] "Q72..Confidence..The.Political.Parties"                                                                                                        
## [107] "Q73..Confidence..Parliament"                                                                                                                   
## [108] "Q74..Confidence..The.Civil.Services"                                                                                                           
## [109] "Q75..Confidence..Universities"                                                                                                                 
## [110] "Q76..Confidence..Elections"                                                                                                                    
## [111] "Q77..Confidence..Major.Companies"                                                                                                              
## [112] "Q78..Confidence..Banks"                                                                                                                        
## [113] "Q79..Confidence..The.Environmental.Protection.Movement"                                                                                        
## [114] "Q80..Confidence..The.Women.s.Movement"                                                                                                         
## [115] "Q81..Confidence..Charitable.or.humanitarian.organizations"                                                                                     
## [116] "Q82..Confidence..Major.regional.organization..combined.from.country.specific."                                                                 
## [117] "Q82_ASEAN..Confidence..The.Association.of.South.East.Asian.Nations..ASEAN."                                                                    
## [118] "Q83..Confidence..The.United.Nations..UN."                                                                                                      
## [119] "Q84..Confidence..International.Monetary.Found..IMF."                                                                                           
## [120] "Q85..Confidence..International.Criminal.Court..ICC."                                                                                           
## [121] "Q86..Confidence..North.Atlantic.Treaty.Organization..NATO."                                                                                    
## [122] "Q87..Confidence..The.World.Bank..WB."                                                                                                          
## [123] "Q88..Confidence..The.World.Health.Organization..WHO."                                                                                          
## [124] "Q89..Confidence..The.World.Trade.Organization..WTO."                                                                                           
## [125] "Q90..International.organizations..being.effective.vs.being.democratic"                                                                         
## [126] "Q91..Countries.with.the.permanent.seats.on.the.UN.Security.Council"                                                                            
## [127] "Q92..Where.are.the.headquarters.of.the.International.Monetary.Fund..IMF..located."                                                             
## [128] "Q93..Which.of.the.following.problems.does.the.organization.Amnesty.International.deal.with."                                                   
## [129] "Q94..Active.Inactive.membership..Church.or.religious.organization"                                                                             
## [130] "Q95..Active.Inactive.membership..Sport.or.recreational.organization..football.baseball.rugby.team"                                             
## [131] "Q96..Active.Inactive.membership..Art..music.or.educational.organization"                                                                       
## [132] "Q97..Active.Inactive.membership..labor.union"                                                                                                  
## [133] "Q98..Active.Inactive.membership..political.party"                                                                                              
## [134] "Q99..Active.Inactive.membership..Environmental.organization"                                                                                   
## [135] "Q100..Active.Inactive.membership..Professional.association"                                                                                    
## [136] "Q101..Active.Inactive.membership..charitable.humanitarian.organization"                                                                        
## [137] "Q102..Active.Inactive.membership..consumer.organization"                                                                                       
## [138] "Q103..Active.Inactive.membership..self.help.group..mutual.aid.group"                                                                           
## [139] "Q104..Active.Inactive.membership..women.s.group"                                                                                               
## [140] "Q105..Active.Inactive.membership..other.organization"                                                                                          
## [141] "Q106..Incomes.should.be.made.more.equal.vs.There.should.be.greater.incentives.for.individual.effort"                                           
## [142] "Q107..Private.vs.state.ownership.of.business"                                                                                                  
## [143] "Q108..Government.s.vs.individual.s.responsibility"                                                                                             
## [144] "Q109..Competition.good.or.harmful"                                                                                                             
## [145] "Q110..Success..hard.work.vs.luck"                                                                                                              
## [146] "Q111..Protecting.environment.vs..Economic.growth"                                                                                              
## [147] "Q112..Perceptions.of.corruption.in.the.country"                                                                                                
## [148] "Q113..Involved.in.corruption..State.authorities"                                                                                               
## [149] "Q114..Involved.in.corruption..Business.executives"                                                                                             
## [150] "Q115..Involved.in.corruption..Local.authorities"                                                                                               
## [151] "Q116..Involved.in.corruption..Civil.service.providers"                                                                                         
## [152] "Q117..Involved.in.corruption..Journalists.and.media"                                                                                           
## [153] "Q118..Frequency.ordinary.people.pay.a.bribe..give.a.gift.or.do.a.favor.to.local.officials.service.providers.in.order.to.get.services"          
## [154] "Q119..Degree.of.agreement..On.the.whole..women.are.less.corrupt.than.men"                                                                      
## [155] "Q120..Risk.to.be.held.accountable.for.giving.or.receiving.a.bribe"                                                                             
## [156] "Q121..Impact.of.immigrants.on.the.development.of.the.country"                                                                                  
## [157] "Q122..Immigration.in.your.country..Fills.useful.jobs.in.the.workforce"                                                                         
## [158] "Q123..Immigration.in.your.country..Strengthens.cultural.diversity"                                                                             
## [159] "Q124..Immigration.in.your.country..Increases.the.crime.rate"                                                                                   
## [160] "Q125..Immigration.in.your.country..Gives.asylum.to.political.refugees"                                                                         
## [161] "Q126..Immigration.in.your.country..Increases.the.risks.of.terrorism"                                                                           
## [162] "Q127..Immigration.in.your.country..Helps.poor.people.establish.new.lives"                                                                      
## [163] "Q128..Immigration.in.your.country..Increases.unemployment"                                                                                     
## [164] "Q129..Immigration.in.your.country..Leads.to.social.conflict"                                                                                   
## [165] "Q130..Immigration.policy.preference"                                                                                                           
## [166] "Q131..Secure.in.neighborhood"                                                                                                                  
## [167] "Q132..Frequency.in.your.neighborhood..Robberies"                                                                                               
## [168] "Q133..Frequency.in.your.neighborhood..Alcohol.consumed.in.the.streets"                                                                         
## [169] "Q134..Frequency.in.your.neighborhood..Police.or.military.interfere.with.people.s.private.life"                                                 
## [170] "Q135..Frequency.in.your.neighborhood..Racist.behavior"                                                                                         
## [171] "Q136..Frequency.in.your.neighborhood..Drug.sale.in.streets"                                                                                    
## [172] "Q137..Frequency.in.your.neighborhood..Street.violence.and.fights"                                                                              
## [173] "Q138..Frequency.in.your.neighborhood..Sexual.harassment"                                                                                       
## [174] "Q139..Things.done.for.reasons.of.security..Didn.t.carry.much.money"                                                                            
## [175] "Q140..Things.done.for.reasons.of.security..Preferred.not.to.go.out.at.night"                                                                   
## [176] "Q141..Things.done.for.reasons.of.security..Carried.a.knife..gun.or.other.weapon"                                                               
## [177] "Q142..Worries..Losing.my.job.or.not.finding.a.job"                                                                                             
## [178] "Q143..Worries..Not.being.able.to.give.one.s.children.a.good.education"                                                                         
## [179] "Q144..Respondent.was.victim.of.a.crime.during.the.past.year"                                                                                   
## [180] "Q145..Respondent.s.family.was.victim.of.a.crime.during.last.year"                                                                              
## [181] "Q146..Worries..A.war.involving.my.country"                                                                                                     
## [182] "Q147..Worries..A.terrorist.attack"                                                                                                             
## [183] "Q148..Worries..A.civil.war"                                                                                                                    
## [184] "Q149..Freedom.and.Equality...Which.more.important"                                                                                             
## [185] "Q150..Freedom.and.security...Which.more.important"                                                                                             
## [186] "Q151..Willingness.to.fight.for.country"                                                                                                        
## [187] "Q152..Aims.of.country..first.choice"                                                                                                           
## [188] "Q153..Aims.of.country..second.choice"                                                                                                          
## [189] "Q154..Aims.of.respondent..first.choice"                                                                                                        
## [190] "Q155..Aims.of.respondent..second.choice"                                                                                                       
## [191] "Q156..Most.important..first.choice"                                                                                                            
## [192] "Q157..Most.important..second.choice"                                                                                                           
## [193] "Q158..Science.and.technology.are.making.our.lives.healthier..easier..and.more.comfortable"                                                     
## [194] "Q159..Because.of.science.and.technology..there.will.be.more.opportunities.for.the.next.generation"                                             
## [195] "Q160..We.depend.too.much.on.science.and.not.enough.on.faith"                                                                                   
## [196] "Q161..One.of.the.bad.effects.of.science.is.that.it.breaks.down.people.s.ideas.of.right.and.wrong"                                              
## [197] "Q162..It.is.not.important.for.me.to.know.about.science.in.my.daily.life"                                                                       
## [198] "Q163..The.world.is.better.off..or.worse.off..because.of.science.and.technology"                                                                
## [199] "Q164..Importance.of.God"                                                                                                                       
## [200] "Q165..Believe.in..God"                                                                                                                         
## [201] "Q166..Believe.in..life.after.death"                                                                                                            
## [202] "Q167..Believe.in..hell"                                                                                                                        
## [203] "Q168..Believe.in..heaven"                                                                                                                      
## [204] "Q169..Whenever.science.and.religion.conflict...religion.is.always.right"                                                                       
## [205] "Q170..The.only.acceptable.religion..is.my.religion"                                                                                            
## [206] "Q171..How.often.do.you.attend.religious.services"                                                                                              
## [207] "Q172..How.often.do.you.pray"                                                                                                                   
## [208] "Q173..Religious.person"                                                                                                                        
## [209] "Q174..Meaning.of.religion..To.follow.religious.norms.and.ceremonies.vs.To.do.good.to.other.people"                                             
## [210] "Q175..Meaning.of.religion..To.make.sense.of.life.after.death.vs.To.make.sense.of.life.in.this.world"                                           
## [211] "Q176..Degree.of.agreement..Nowadays.one.often.has.trouble.deciding.which.moral.rules.are.the.right.ones.to.follow"                             
## [212] "Q177..Justifiable..Claiming.government.benefits.to.which.you.are.not.entitled"                                                                 
## [213] "Q178..Justifiable..Avoiding.a.fare.on.public.transport"                                                                                        
## [214] "Q179..Justifiable..Stealing.property"                                                                                                          
## [215] "Q180..Justifiable..Cheating.on.taxes"                                                                                                          
## [216] "Q181..Justifiable..Someone.accepting.a.bribe.in.the.course.of.their.duties"                                                                    
## [217] "Q182..Justifiable..Homosexuality"                                                                                                              
## [218] "Q183..Justifiable..Prostitution"                                                                                                               
## [219] "Q184..Justifiable..Abortion"                                                                                                                   
## [220] "Q185..Justifiable..Divorce"                                                                                                                    
## [221] "Q186..Justifiable..Sex.before.marriage"                                                                                                        
## [222] "Q187..Justifiable..Suicide"                                                                                                                    
## [223] "Q188..Justifiable..Euthanasia"                                                                                                                 
## [224] "Q189..Justifiable..For.a.man.to.beat.his.wife"                                                                                                 
## [225] "Q190..Justifiable..Parents.beating.children"                                                                                                   
## [226] "Q191..Justifiable..Violence.against.other.people"                                                                                              
## [227] "Q192..Justifiable..Terrorism.as.a.political..ideological.or.religious.mean"                                                                    
## [228] "Q193..Justifiable..Having.casual.sex"                                                                                                          
## [229] "Q194..Justifiable..Political.violence"                                                                                                         
## [230] "Q195..Justifiable..Death.penalty"                                                                                                              
## [231] "Q196..Government.has.the.right..Keep.people.under.video.surveillance.in.public.areas"                                                          
## [232] "Q197..Government.has.the.right..Monitor.all.e.mails.and.any.other.information.exchanged.on.the.Internet"                                       
## [233] "Q198..Government.has.the.right..Collect.information.about.anyone.living.in..COUNTRY..without.their.knowledge"                                  
## [234] "Q199..Interest.in.politics"                                                                                                                    
## [235] "Q200..How.often.discusses.political.matters.with.friends"                                                                                      
## [236] "Q201..Information.source..Daily.newspaper"                                                                                                     
## [237] "Q202..Information.source..TV.news"                                                                                                             
## [238] "Q203..Information.source..Radio.news"                                                                                                          
## [239] "Q204..Information.source..Mobile.phone"                                                                                                        
## [240] "Q205..Information.source..Email"                                                                                                               
## [241] "Q206..Information.source..Internet"                                                                                                            
## [242] "Q207..Information.source..Social.media..Facebook..Twitter..etc.."                                                                              
## [243] "Q208..Information.source..Talk.with.friends.or.colleagues"                                                                                     
## [244] "Q209..Political.action..Signing.a.petition"                                                                                                    
## [245] "Q210..Political.action..Joining.in.boycotts"                                                                                                   
## [246] "Q211..Political.action..Attending.lawful.peaceful.demonstrations"                                                                              
## [247] "Q212..Political.action..Joining.unofficial.strikes"                                                                                            
## [248] "Q213..Social.activism..Donating.to.a.group.or.campaign"                                                                                        
## [249] "Q214..Social.activism..Contacting.a.government.official"                                                                                       
## [250] "Q215..Social.activism..Encouraging.others.to.take.action.about.political.issues"                                                               
## [251] "Q216..Social.activism..Encouraging.others.to.vote"                                                                                             
## [252] "Q217..Political.actions.online..Searching.information.about.politics.and.political.events"                                                     
## [253] "Q218..Political.actions.online..Signing.an.electronic.petition"                                                                                
## [254] "Q219..Political.actions.online..Encouraging.other.people.to.take.any.form.of.political.action"                                                 
## [255] "Q220..Political.actions.online..Organizing.political.activities..events..protests"                                                             
## [256] "Q221..Vote.in.elections..local.level"                                                                                                          
## [257] "Q222..Vote.in.elections..national.level"                                                                                                       
## [258] "Q223..Which.party.would.you.vote.for.if.there.were.a.national.election.tomorrow"                                                               
## [259] "Q223_ABREV..Party.preference.Abbreviation"                                                                                                     
## [260] "Q223_LOCAL..Party.preference.Local.name"                                                                                                       
## [261] "Q224..How.often.in.country.s.elections..Votes.are.counted.fairly"                                                                              
## [262] "Q225..How.often.in.country.s.elections..Opposition.candidates.are.prevented.from.running"                                                      
## [263] "Q226..How.often.in.country.s.elections..TV.news.favors.the.governing.party"                                                                    
## [264] "Q227..How.often.in.country.s.elections..Voters.are.bribed"                                                                                     
## [265] "Q228..How.often.in.country.s.elections..Journalists.provide.fair.coverage.of.elections"                                                        
## [266] "Q229..How.often.in.country.s.elections..Election.officials.are.fair"                                                                           
## [267] "Q230..How.often.in.country.s.elections..Rich.people.buy.elections"                                                                             
## [268] "Q231..How.often.in.country.s.elections..Voters.are.threatened.with..violence.at.the.polls"                                                     
## [269] "Q232..How.often.in.country.s.elections..Voters.are.offered.a.genuine.choice.in.the.elections"                                                  
## [270] "Q233..How.often.in.country.s.elections..Women.have.equal.opportunities.to.run.the.office"                                                      
## [271] "Q234..Some.people.think.that.having.honest.elections.makes.a.lot.of.difference.in.their.lives...other.people.think.that.it.doesn.t.matter.much"
## [272] "Q234A..How.much.would.you.say.the.political.system.in.your.country.allows.people.like.you.to.have.a.say.in.what.the.government.does."          
## [273] "Q235..Political.system..Having.a.strong.leader.who.does.not.have.to.bother.with.parliament.and.elections"                                      
## [274] "Q236..Political.system..Having.experts..not.government..make.decisions.according.to.what.they.think.is.best.for.the.country"                   
## [275] "Q237..Political.system..Having.the.army.rule"                                                                                                  
## [276] "Q238..Political.system..Having.a.democratic.political.system"                                                                                  
## [277] "Q239..Political.system..Having.a.system.governed.by.religious.law.in.which.there.are.no.political.parties.or.elections"                        
## [278] "Q240..Left.right.political.scale"                                                                                                              
## [279] "Q241..Democracy..Governments.tax.the.rich.and.subsidize.the.poor"                                                                              
## [280] "Q242..Democracy..Religious.authorities.interpret.the.laws"                                                                                     
## [281] "Q243..Democracy..People.choose.their.leaders.in.free.elections"                                                                                
## [282] "Q244..Democracy..People.receive.state.aid.for.unemployment"                                                                                    
## [283] "Q245..Democracy..The.army.takes.over.when.government.is.incompetent"                                                                           
## [284] "Q246..Democracy..Civil.rights.protect.people.s.liberty.against.oppression"                                                                     
## [285] "Q247..Democracy..The.state.makes.people.s.incomes.equal"                                                                                       
## [286] "Q248..Democracy..People.obey.their.rulers"                                                                                                     
## [287] "Q249..Democracy..Women.have.the.same.rights.as.men"                                                                                            
## [288] "Q250..Importance.of.democracy"                                                                                                                 
## [289] "Q251..How.democratically.is.this.country.being.governed.today"                                                                                 
## [290] "Q252..Satisfaction.with.the.political.system.performance"                                                                                      
## [291] "Q253..Respect.for.individual.human.rights.nowadays"                                                                                            
## [292] "Q254..National.pride"                                                                                                                          
## [293] "Q255..Feel.close.to.your.village..town.or.city"                                                                                                
## [294] "Q256..Feel.close.to.your.district..region"                                                                                                     
## [295] "Q257..Feel.close.to.your.country"                                                                                                              
## [296] "Q258..Feel.close.to.your.continent"                                                                                                            
## [297] "Q259..Feel.close.to.the.world"                                                                                                                 
## [298] "Q260..Sex"                                                                                                                                     
## [299] "Q261..Year.of.birth"                                                                                                                           
## [300] "Q262..Age"                                                                                                                                     
## [301] "X003R..Age.recoded..6.intervals."                                                                                                              
## [302] "X003R2..Age.recoded..3.intervals."                                                                                                             
## [303] "Q263..Respondent.immigrant"                                                                                                                    
## [304] "Q264..Mother.immigrant"                                                                                                                        
## [305] "Q265..Father.immigrant"                                                                                                                        
## [306] "Q266..Country.of.birth..Respondent"                                                                                                            
## [307] "Q267..Country.of.birth..Mother.of.the.respondent"                                                                                              
## [308] "Q268..Country.of.birth..Father.of.the.respondent"                                                                                              
## [309] "Q269..Respondent.citizen"                                                                                                                      
## [310] "Q270..Number.of.people.in.household"                                                                                                           
## [311] "Q271..Do.you.live.with.your.parents"                                                                                                           
## [312] "Q272..Language.at.home"                                                                                                                        
## [313] "Q273..Marital.status"                                                                                                                          
## [314] "Q274..How.many.children.do.you.have"                                                                                                           
## [315] "Q275..Highest.educational.level..Respondent..ISCED.2011."                                                                                      
## [316] "Q275A..Highest.educational.level..Respondent..country.specific."                                                                               
## [317] "Q275R..Highest.educational.level..Respondent..recoded.into.3.groups."                                                                          
## [318] "Q276..Highest.educational.level..Respondent.s.Spouse..ISCED.2011."                                                                             
## [319] "Q276A..Highest.educational.level..Respondent.s.Spouse..country.specific."                                                                      
## [320] "Q276R..Highest.educational.level..Respondent.s.Spouse..recoded.into.3.groups."                                                                 
## [321] "Q277..Highest.educational.level..Respondent.s.Mother..ISCED.2011."                                                                             
## [322] "Q277A..Highest.educational.level..Respondent.s.Mother..country.specific."                                                                      
## [323] "Q277R..Highest.educational.level..Respondent.s.Mother..recoded.into.3.groups."                                                                 
## [324] "Q278..Highest.educational.level..Respondent.s.Father..ISCED.2011."                                                                             
## [325] "Q278A..Highest.educational.level..Respondent.s.Father..country.specific."                                                                      
## [326] "Q278R..Highest.educational.level..Respondent.s.Father..recoded.into.3.groups."                                                                 
## [327] "Q279..Employment.status"                                                                                                                       
## [328] "Q280..Employment.status...Respondent.s.Spouse"                                                                                                 
## [329] "Q281..Respondent...Occupational.group"                                                                                                         
## [330] "Q282..Respondent.s.Spouse...Occupational.group"                                                                                                
## [331] "Q283..Respondent.s.Father...Occupational.group..when.respondent.was.14.years.old."                                                             
## [332] "Q284..Sector.of.employment"                                                                                                                    
## [333] "Q285..Are.you.the.chief.wage.earner.in.your.house"                                                                                             
## [334] "Q286..Family.savings.during.past.year"                                                                                                         
## [335] "Q287..Social.class..subjective."                                                                                                               
## [336] "Q288..Scale.of.incomes"                                                                                                                        
## [337] "Q288R..Income.level..Recoded."                                                                                                                 
## [338] "Q289..Religious.denominations...major.groups"                                                                                                  
## [339] "Q289CS9..Religious.denomination...detailed.list"                                                                                               
## [340] "Q290..Ethnic.group"                                                                                                                            
## [341] "Y001..Post.Materialist.index.12.item"                                                                                                          
## [342] "Y002..Post.Materialist.index.4.item"                                                                                                           
## [343] "Y003..Autonomy.Index"                                                                                                                          
## [344] "SACSECVAL..SACSECVAL...Welzel.Overall.Secular.Values"                                                                                          
## [345] "SACSECVALB..Overall.Secular.Values.Short.version"                                                                                              
## [346] "RESEMAVAL..RESEMAVAL...Welzel.emancipative.values"                                                                                             
## [347] "RESEMAVALB..Emancipative.values.Short.version"                                                                                                 
## [348] "I_AUTHORITY..AUTHORITY...Welzel.defiance...1..Inverse.respect.for.authority"                                                                   
## [349] "I_NATIONALISM..NATIONALISM...Welzel.defiance...2..Inverse.national.pride"                                                                      
## [350] "I_DEVOUT..DEVOUT..Welzel.defiance...3..Inverse.devoutness"                                                                                     
## [351] "DEFIANCE..DEFIANCE...Welzel.defiance.sub.index"                                                                                                
## [352] "I_RELIGIMP..RELIGIMP...Welzel.disbelief..1..Inverse.importance.of.religion"                                                                    
## [353] "I_RELIGBEL..RELIGBEL...Welzel.disbelief..2..Inverse.religious.person"                                                                          
## [354] "I_RELIGPRAC..RELIGPRAC...Welzel.disbelief..3..Inverse.religious.practice"                                                                      
## [355] "DISBELIEF..DISBELIEF...Welzel.disbelief.sub.index"                                                                                             
## [356] "I_NORM1..NORM1...Welzel.relativism..1..Inverse.norm.conform1"                                                                                  
## [357] "I_NORM2..NORM2...Welzel.relativism..2..Inverse.norm.conform2"                                                                                  
## [358] "I_NORM3..NORM3...Welzel.relativism..3..Inverse.norm.conform3"                                                                                  
## [359] "RELATIVISM..RELATIVISM...Welzel.relativism"                                                                                                    
## [360] "I_TRUSTARMY..TRUSTARMY..Welzel.skepticism..1..Inverse.trust.in.army"                                                                           
## [361] "I_TRUSTPOLICE..TRUSTPOLICE..Welzel.skepticism..2..Inverse.trust.in.police"                                                                     
## [362] "I_TRUSTCOURTS..TRUSTCOURTS..Welzel.skepticism..3..Inverse.trust.in.courts"                                                                     
## [363] "SCEPTICISM..SCEPTICISM...Welzel.skepticism.index"                                                                                              
## [364] "I_INDEP..INDEP..Welzel.autonomy.1..Independence.as.kid.quality"                                                                                
## [365] "I_IMAGIN..IMAGIN..Welzel.autonomy.2..Imagination.as.kid.quality"                                                                               
## [366] "I_NONOBED..Emancipative.Values.1..Obedience.not.kid.quality"                                                                                   
## [367] "AUTONOMY..AUTONOMY...Wezel.Autonomy.sub.index"                                                                                                 
## [368] "I_WOMJOB..WOMJOB..Welzel.equality.1..Gender.equality..job"                                                                                     
## [369] "I_WOMPOL..WOMPOL..Welzel.equality.2..Gender.equality..politics"                                                                                
## [370] "I_WOMEDU..WOMEDU..Welzel.equality.3..Gender.equality..education"                                                                               
## [371] "EQUALITY..Emancipative.Values.2..Equality.sub.index"                                                                                           
## [372] "I_HOMOLIB..HOMOLIB..Welzel.choice.1..Homosexuality.acceptance"                                                                                 
## [373] "I_ABORTLIB..ABORTLIB..Welzel.choice.2..Abortion.acceptable"                                                                                    
## [374] "I_DIVORLIB..DIVORLIB..Welzel.choice.3..Divorce.acceptable"                                                                                     
## [375] "CHOICE..CHOICE...Welzel.choice.sub.index"                                                                                                      
## [376] "I_VOICE1..VOICE1..Welzel.voice.1"                                                                                                              
## [377] "I_VOICE2..VOICE2..Welzel.voice.2"                                                                                                              
## [378] "I_VOI2_00..VOI2_00..Welzel.voice.3..auxiliary."                                                                                                
## [379] "VOICE..VOICE...Welzel.voice.sub.index"                                                                                                         
## [380] "SECVALWGT..Weight.for.overall.secular.values"                                                                                                  
## [381] "WEIGHT1A..Overall.Secular.Values.1..Weight1a"                                                                                                  
## [382] "WEIGHT1B..Emancipative.Values.1..Weight1b"                                                                                                     
## [383] "WEIGHT2A..Overall.Secular.Values.2..Weight2a"                                                                                                  
## [384] "WEIGHT2B..Emancipative.Values.2..Weight2b"                                                                                                     
## [385] "WEIGHT3A..Overall.Secular.Values.3..Weight"                                                                                                    
## [386] "WEIGHT3B..Emancipative.Values.3..Weight3b"                                                                                                     
## [387] "WEIGHT4A..Overall.Secular.Values.4..Weight.4a"                                                                                                 
## [388] "WEIGHT4B..Emancipative.Values.4..Weight.4b"                                                                                                    
## [389] "RESEMAVALBWGT..Weight.for.Emancipative.values"                                                                                                 
## [390] "RESEMAVALWGT..Weight.for.Emancipative.values"                                                                                                  
## [391] "SECVALBWGT..Weight.for.overall.secular.values.Short.Version"                                                                                   
## [392] "Y001_1..Materialist.postmaterialist.12.item.index..Component.1"                                                                                
## [393] "Y001_2..Materialist.postmaterialist.12.item.index..Component.2"                                                                                
## [394] "Y001_3..Materialist.postmaterialist.12.item.index..Component.3"                                                                                
## [395] "Y001_4..Materialist.postmaterialist.12.item.index..Component.4"                                                                                
## [396] "Y001_5..Materialist.postmaterialist.12.item.index..Component.5"                                                                                
## [397] "H295..How.old.were.you.when.you.had.your.first.child"                                                                                          
## [398] "H296..How.many.children.would.you.like.to.have"                                                                                                
## [399] "H297..Free.choice.and.control.over.family.planning"                                                                                            
## [400] "H298..Honour.related.oppression..family.decides.on.young.women.s.life.choice"                                                                  
## [401] "H299..Justifiable..Female.genital.circumcision"                                                                                                
## [402] "H300..Justifiable..To.use.contraceptives"                                                                                                      
## [403] "H301..Justifiable..To.have.more.than.one.sexual.partner.at.the.same.time"                                                                      
## [404] "H302..Justifiable..Getting.paid.for.porongraphic.photos.or.films"                                                                              
## [405] "H311..How.often.in.neighbourhood..Sexual.assault.rape"                                                                                         
## [406] "H312..How.often.in.neighbourhood..Women.and.girls.trading.sex.for.money"                                                                       
## [407] "H313..How.often.in.neighbourhood..Men.and.boys.hurting.women.and.girls"                                                                        
## [408] "H314..How.often.in.neighbourhood..Men.and.boys.making.unwanted.sexual.comments.or.gestures.towards.girls.or.women"                             
## [409] "H315..A.husband.shouldn.t.have.to.do.household.chores"                                                                                         
## [410] "H316..A.man.who.discusses.important.decisions.with.his.wife.is.considered.weak"                                                                
## [411] "H317..A.man.should.pay.more.attention.to.his.mother.s.opinion.than.his.wife.s"                                                                 
## [412] "H318..A.woman.who.shows.that.she.is.interested.in.sex.is.considered.vulgar"                                                                    
## [413] "H319..Men.may.use.violence.to.keep.their.wives.in.line"                                                                                        
## [414] "H320..Parents.may.use.violence.or.threats.when.bringing.up.their.children"                                                                     
## [415] "H321..A.woman.should.tolerate.violence.to.keep.the.family.together"                                                                            
## [416] "H322..No.one.else.should.interfere.when.it.comes.to.violence.within.a.family"                                                                  
## [417] "H326..If.a.man.has.a.girlfriend.or.wife..he.should.know.where.she.is.all.the.time"                                                             
## [418] "H331..It.is.important.for.girls.to.continue.their.schooling.even.if.they.become.pregnant.and.have.children"                                    
## [419] "H332..A.girl.is.ready.for.marriage.once.she.starts.menstruating"                                                                               
## [420] "H333..A.girl.should.honour.the.decisions.wishes.of.her.family.even.if.she.does.not.want.to.marry"                                              
## [421] "H334..A.boy.should.honour.the.decisions.wishes.of.his.family.even.if.he.does.not.want.to.marry"                                                
## [422] "H335..A.girl.should.wait.to.have.children.until.she.is.at.least.18.years.old..even.if.she.is.married"                                          
## [423] "H336..It.is.safer.for.a.woman.to.give.birth.at.a.clinic.than.at.home"                                                                          
## [424] "H337..Women.should.have.access.to.safe.abortion.services..to.terminate.an.unwanted.pregnancy."                                                 
## [425] "H338..It.is.a.woman.s.responsibility.to.avoid.getting.pregnant"                                                                                
## [426] "H339..Only.when.a.woman.has.a.child.is.she.a.real.woman"                                                                                       
## [427] "H341..Contraceptives.should.be.available.for.everyone..whether.or.not.one.is.married"                                                          
## [428] "H342..Sexual.education.promotes.sexual.activity.among.young.people"                                                                            
## [429] "H343..Sexual.education.helps.people.make.informed.decisions"                                                                                   
## [430] "H344..A.couple.who.cannot.conceive.should.have.access.to.infertility.services"                                                                 
## [431] "H345..People.who.dress..act.or.identify.as.the.opposite.sex.should.be.treated.just.as.anyone.else"                                             
## [432] "H349..A.homosexual.man.is.not.a..real.man."                                                                                                    
## [433] "H350..A..real.man..should.have.as.many.sexual.partners.as.he.can"                                                                              
## [434] "H351..A.man.should.use.violence..to.get.respect..if.necessary"
view(df)
#selecting specific questions that form part of our index that fall under each category 
dat7<- df%>%
  select("Q184..Justifiable..Abortion", "Q186..Justifiable..Sex.before.marriage",
         "Q33..Jobs.scarce..Men.should.have.more.right.to.a.job.than.women","Q28..Pre.school.child.suffers.with.working.mother",
         "Q31..Men.make.better.business.executives.than.women.do", "Q29..Men.make.better.political.leaders.than.women.do", 
         "Q262..Age", "Q288R..Income.level..Recoded.", "Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.",
         "Q279..Employment.status", "Q260..Sex", "Q35..Problem.if.women.have.more.income.than.husband", "Q30..University.is.more.important.for.a.boy.than.for.a.girl",
         "Q28..Pre.school.child.suffers.with.working.mother","Q32..Being.a.housewife.just.as.fulfilling", "Q240..Left.right.political.scale","A_YEAR..Year.of.survey"
  )
#-1 value assigned to those who didn't want to reply, no analytical value, skews data, so replace value with 0 
dat7 <- dat7 %>%
  mutate(across(c(Q184..Justifiable..Abortion, 
                  Q186..Justifiable..Sex.before.marriage, 
                  Q33..Jobs.scarce..Men.should.have.more.right.to.a.job.than.women, 
                  Q28..Pre.school.child.suffers.with.working.mother, 
                  Q31..Men.make.better.business.executives.than.women.do, 
                  Q29..Men.make.better.political.leaders.than.women.do,
                  Q35..Problem.if.women.have.more.income.than.husband,
                  Q30..University.is.more.important.for.a.boy.than.for.a.girl,
                  Q28..Pre.school.child.suffers.with.working.mother,
                  Q32..Being.a.housewife.just.as.fulfilling), 
                ~ ifelse(. == -1, 0, .)))
view(dat7)
#overall summary stats 
summary(dat7)
##  Q184..Justifiable..Abortion Q186..Justifiable..Sex.before.marriage
##  Min.   : 0.000              Min.   : 0.000                        
##  1st Qu.: 1.000              1st Qu.: 1.000                        
##  Median : 1.000              Median : 1.000                        
##  Mean   : 2.624              Mean   : 2.173                        
##  3rd Qu.: 4.000              3rd Qu.: 2.000                        
##  Max.   :10.000              Max.   :10.000                        
##  Q33..Jobs.scarce..Men.should.have.more.right.to.a.job.than.women
##  Min.   :0.000                                                   
##  1st Qu.:1.000                                                   
##  Median :2.000                                                   
##  Mean   :2.479                                                   
##  3rd Qu.:4.000                                                   
##  Max.   :5.000                                                   
##  Q28..Pre.school.child.suffers.with.working.mother
##  Min.   :0.000                                    
##  1st Qu.:1.000                                    
##  Median :2.000                                    
##  Mean   :1.984                                    
##  3rd Qu.:3.000                                    
##  Max.   :4.000                                    
##  Q31..Men.make.better.business.executives.than.women.do
##  Min.   :0.000                                         
##  1st Qu.:1.000                                         
##  Median :2.000                                         
##  Mean   :2.395                                         
##  3rd Qu.:3.000                                         
##  Max.   :4.000                                         
##  Q29..Men.make.better.political.leaders.than.women.do   Q262..Age   
##  Min.   :0.000                                        Min.   :16.0  
##  1st Qu.:1.000                                        1st Qu.:21.0  
##  Median :2.000                                        Median :33.0  
##  Mean   :2.248                                        Mean   :35.8  
##  3rd Qu.:3.000                                        3rd Qu.:48.0  
##  Max.   :4.000                                        Max.   :90.0  
##  Q288R..Income.level..Recoded.
##  Min.   :-1.000               
##  1st Qu.: 1.000               
##  Median : 2.000               
##  Mean   : 1.931               
##  3rd Qu.: 2.000               
##  Max.   : 3.000               
##  Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.
##  Min.   :-1.000                                                      
##  1st Qu.: 1.000                                                      
##  Median : 2.000                                                      
##  Mean   : 1.904                                                      
##  3rd Qu.: 2.000                                                      
##  Max.   : 3.000                                                      
##  Q279..Employment.status   Q260..Sex    
##  Min.   :-1.000          Min.   :1.000  
##  1st Qu.: 3.000          1st Qu.:1.000  
##  Median : 5.000          Median :1.000  
##  Mean   : 4.243          Mean   :1.434  
##  3rd Qu.: 6.000          3rd Qu.:2.000  
##  Max.   : 8.000          Max.   :2.000  
##  Q35..Problem.if.women.have.more.income.than.husband
##  Min.   :0.000                                      
##  1st Qu.:1.000                                      
##  Median :2.000                                      
##  Mean   :2.467                                      
##  3rd Qu.:3.000                                      
##  Max.   :5.000                                      
##  Q30..University.is.more.important.for.a.boy.than.for.a.girl
##  Min.   :0.000                                              
##  1st Qu.:2.000                                              
##  Median :3.000                                              
##  Mean   :2.798                                              
##  3rd Qu.:4.000                                              
##  Max.   :4.000                                              
##  Q32..Being.a.housewife.just.as.fulfilling Q240..Left.right.political.scale
##  Min.   :0.000                             Min.   :-1.000                  
##  1st Qu.:1.000                             1st Qu.:-1.000                  
##  Median :2.000                             Median : 5.000                  
##  Mean   :2.211                             Mean   : 4.236                  
##  3rd Qu.:3.000                             3rd Qu.: 7.000                  
##  Max.   :4.000                             Max.   :10.000                  
##  A_YEAR..Year.of.survey
##  Min.   :2022          
##  1st Qu.:2022          
##  Median :2022          
##  Mean   :2022          
##  3rd Qu.:2022          
##  Max.   :2022
#creating column for overall score for each bucket
dat7 <- dat7 %>%
  mutate(lib = Q184..Justifiable..Abortion + Q186..Justifiable..Sex.before.marriage,
         sup = Q33..Jobs.scarce..Men.should.have.more.right.to.a.job.than.women + Q35..Problem.if.women.have.more.income.than.husband + Q30..University.is.more.important.for.a.boy.than.for.a.girl ,
         trad =Q28..Pre.school.child.suffers.with.working.mother + Q31..Men.make.better.business.executives.than.women.do + Q29..Men.make.better.political.leaders.than.women.do + Q32..Being.a.housewife.just.as.fulfilling,
         prog = lib + sup + trad)
view(dat7) 
# summary stats of each 
libstats <- dat7 %>%
  summarise(
    Mean = mean(lib, na.rm = TRUE),
    Median = median(lib, na.rm = TRUE),
    Standard_Deviation = sd(lib, na.rm = TRUE),
    Min = min(lib, na.rm = TRUE),
    Max = max(lib, na.rm = TRUE)
  )
print(libstats)
##      Mean Median Standard_Deviation Min Max
## 1 4.79669      3           4.027556   0  20
supstats <- dat7 %>%
  summarise(
    Mean = mean(sup, na.rm = TRUE),
    Median = median(sup, na.rm = TRUE),
    Standard_Deviation = sd(lib, na.rm = TRUE),
    Min = min(sup, na.rm = TRUE),
    Max = max(sup, na.rm = TRUE)
  )
print(supstats)
##       Mean Median Standard_Deviation Min Max
## 1 7.744681      7           4.027556   0  14
tradstats <- dat7 %>%
  summarise(
    Mean = mean(trad, na.rm = TRUE),
    Median = median(trad, na.rm = TRUE),
    Standard_Deviation = sd(trad, na.rm = TRUE),
    Min = min(trad, na.rm = TRUE),
    Max = max(trad, na.rm = TRUE)
  )
print(tradstats)
##       Mean Median Standard_Deviation Min Max
## 1 8.838652      9           3.006297   0  16
progstats <- dat7 %>%
  summarise(
    Mean = mean(prog, na.rm = TRUE),
    Median = median(prog, na.rm = TRUE),
    Standard_Deviation = sd(prog, na.rm = TRUE),
    Min = min(prog, na.rm = TRUE),
    Max = max(prog, na.rm = TRUE)
  )
print(progstats)
##       Mean Median Standard_Deviation Min Max
## 1 21.38002     21           6.993815   0  45
# barplots
ggplot(data = dat7, aes(x = lib)) +
  geom_bar(fill = "lightblue") +
  theme_minimal() +
  labs(x = "scores", y = "respondents", title = "scores on liberation")

ggplot(data = dat7, aes(x = sup)) +
  geom_bar(fill = "lightblue") +
  theme_minimal() +
  labs(x = "scores", y = "respondents", title = "scores on superiority of men")

ggplot(data = dat7, aes(x = trad)) +
  geom_bar(fill = "lightblue") +
  theme_minimal() +
  labs(x = "scores", y = "respondents", title = "scores on traditional roles")

ggplot(data = dat7, aes(x = prog)) +
  geom_bar(fill = "lightblue") +
  theme_minimal() +
  labs(x = "scores", y = "respondents", title = "scores on progressiveness")

#density plots
ggplot(data = dat7, aes(x = lib)) +
  geom_density(fill = "blue", alpha = 1) +
  labs(title = "liberation", x = "scores", y = "Density") +
  theme_minimal()

ggplot(data = dat7, aes(x = sup)) +
  geom_density(fill = "blue", alpha = 1) +
  labs(title = "superiority", x = "scores", y = "Density") +
  theme_minimal()

ggplot(data = dat7, aes(x = trad)) +
  geom_density(fill = "blue", alpha = 1) +
  labs(title = "traditionality", x = "scores", y = "Density") +
  theme_minimal()

ggplot(data = dat7, aes(x = prog)) +
  geom_density(fill = "blue", alpha = 1) +
  labs(title = "progressiveness", x = "scores", y = "Density") +
  theme_minimal()

##employment status 
#liberation
t.test(dat7$Q279..Employment.status, dat7$lib, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q279..Employment.status and dat7$lib
## t = -4.9426, df = 2639, p-value = 8.193e-07
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.7726588 -0.3337242
## sample estimates:
## mean of x mean of y 
##  4.243499  4.796690
ggplot(dat7, aes(x = factor(Q279..Employment.status), y = lib)) +
  geom_boxplot() +
  labs(title = "Distribution of Liberation Scores by Employment Status",
       x = "Employment Status",
       y = "Liberation Score") +
  scale_x_discrete(labels = c("1" = "Unemployed", "2" = "Part-time", "3" = "Full-time", 
                              "4" = "Self-employed", "5" = "Retired", "6" = "Student", 
                              "7" = "Unable to work", "8" = "Other")) +
  theme_minimal()

#superiority  
t.test(dat7$Q279..Employment.status, dat7$sup, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q279..Employment.status and dat7$sup
## t = -38.904, df = 3145.8, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -3.677639 -3.324725
## sample estimates:
## mean of x mean of y 
##  4.243499  7.744681
ggplot(dat7, aes(x = factor(Q279..Employment.status), y = sup)) +
  geom_boxplot() +
  labs(title = "Distribution of Male superiority Scores by Employment Status",
       x = "Employment Status",
       y = "Belief in Male Superiority Score") +
  theme_minimal()

#traditional roles
t.test(dat7$Q279..Employment.status, dat7$trad, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q279..Employment.status and dat7$trad
## t = -50.495, df = 3119.7, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -4.773584 -4.416723
## sample estimates:
## mean of x mean of y 
##  4.243499  8.838652
ggplot(dat7, aes(x = factor(Q279..Employment.status), y = trad)) +
  geom_boxplot() +
  labs(title = "Distribution of traditional Scores by Employment Status",
       x = "Employment Status",
       y = "Belief in traditional roles Score") +
  theme_minimal()

# overall progressive
t.test(dat7$Q279..Employment.status, dat7$prog, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q279..Employment.status and dat7$prog
## t = -96.024, df = 2031.4, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -17.48651 -16.78654
## sample estimates:
## mean of x mean of y 
##  4.243499 21.380024
ggplot(dat7, aes(x = factor(Q279..Employment.status), y = trad)) +
  geom_boxplot() +
  labs(title = "Distribution of progressiveness by Employment Status",
       x = "Employment Status",
       y = "Belief in traditional roles Score") +
  theme_minimal()

##Age 
#liberation
t.test(dat7$Q262..Age, dat7$lib, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q262..Age and dat7$lib
## t = 75.843, df = 1896, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  30.20529 31.80890
## sample estimates:
## mean of x mean of y 
##  35.80378   4.79669
dat7 <- dat7 %>%
  mutate(age_bucket = cut(Q262..Age, breaks = c(0, 18, 25, 35, 45, 55, 65, 100),
                          labels = c("Under 18", "19-25", "26-35", "36-45", "46-55", "56-65", "Over 65")))
age_summary_lib <- dat7 %>%
  group_by(age_bucket,lib) %>%
  summarise(
    Mean = mean(Q262..Age),
    Median = median(Q262..Age),
    .groups = 'drop'  # This option removes the grouping structure afterwards
  )

# Display the table
print(age_summary_lib)
## # A tibble: 129 × 4
##    age_bucket   lib  Mean Median
##    <fct>      <dbl> <dbl>  <dbl>
##  1 Under 18       0  16.4     16
##  2 Under 18       1  16.5     16
##  3 Under 18       2  16.6     16
##  4 Under 18       3  16.8     17
##  5 Under 18       4  16.6     17
##  6 Under 18       5  16.7     17
##  7 Under 18       6  17       17
##  8 Under 18       7  16.8     17
##  9 Under 18       8  17.1     17
## 10 Under 18       9  16.8     17
## # ℹ 119 more rows
ggplot(dat7, aes(x = age_bucket, y = lib, fill = age_bucket)) +
  geom_boxplot() +
  labs(title = "Liberation Scores by Age Group",
       x = "Age Group",
       y = "Liberation Score") +
  theme_minimal() +
  scale_fill_brewer(palette = "Paired")

#sup
t.test(dat7$Q262..Age, dat7$sup, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q262..Age and dat7$sup
## t = 69.56, df = 1801.6, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  27.26796 28.85024
## sample estimates:
## mean of x mean of y 
## 35.803783  7.744681
age_summary_sup <- dat7 %>%
  group_by(age_bucket,sup) %>%
  summarise(
    Mean = mean(Q262..Age),
    Median = median(Q262..Age),
    .groups = 'drop'  # This option removes the grouping structure afterwards
  )

# Display the table
print(age_summary_sup)
## # A tibble: 94 × 4
##    age_bucket   sup  Mean Median
##    <fct>      <dbl> <dbl>  <dbl>
##  1 Under 18       0  16.5   16.5
##  2 Under 18       2  16.2   16  
##  3 Under 18       3  16.6   16.5
##  4 Under 18       4  16.4   16  
##  5 Under 18       5  16.6   16  
##  6 Under 18       6  16.8   17  
##  7 Under 18       7  16.5   16  
##  8 Under 18       8  16.7   17  
##  9 Under 18       9  16.6   17  
## 10 Under 18      10  16.7   17  
## # ℹ 84 more rows
ggplot(dat7, aes(x = age_bucket, y = sup, fill = age_bucket)) +
  geom_boxplot() +
  labs(title = "Belief in Male superiority Scores by Age Group",
       x = "Age Group",
       y = "Score") +
  theme_minimal() +
  scale_fill_brewer(palette = "Paired")

#tradtional
t.test(dat7$Q262..Age, dat7$trad, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q262..Age and dat7$trad
## t = 66.811, df = 1805.5, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  26.17355 27.75671
## sample estimates:
## mean of x mean of y 
## 35.803783  8.838652
age_summary_trad <- dat7 %>%
  group_by(age_bucket,trad) %>%
  summarise(
    Mean = mean(Q262..Age),
    Median = median(Q262..Age),
    .groups = 'drop'  # This option removes the grouping structure afterwards
  )

# Display the table
print(age_summary_trad)
## # A tibble: 108 × 4
##    age_bucket  trad  Mean Median
##    <fct>      <dbl> <dbl>  <dbl>
##  1 Under 18       0  16       16
##  2 Under 18       1  16.7     17
##  3 Under 18       2  16.6     17
##  4 Under 18       4  16.7     17
##  5 Under 18       5  16.7     17
##  6 Under 18       6  16.6     17
##  7 Under 18       7  16.6     16
##  8 Under 18       8  16.8     17
##  9 Under 18       9  16.8     17
## 10 Under 18      10  16.5     16
## # ℹ 98 more rows
ggplot(dat7, aes(x = age_bucket, y = trad, fill = age_bucket)) +
  geom_boxplot() +
  labs(title = "Belief in traditional norms Scores by Age Group",
       x = "Age Group",
       y = "Score") +
  theme_minimal() +
  scale_fill_brewer(palette = "Paired")

# overall progressive
t.test(dat7$Q262..Age, dat7$prog, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q262..Age and dat7$prog
## t = 33.403, df = 2291.3, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  13.57697 15.27055
## sample estimates:
## mean of x mean of y 
##  35.80378  21.38002
age_summary_prog <- dat7 %>%
  group_by(age_bucket,prog) %>%
  summarise(
    Mean = mean(Q262..Age),
    Median = median(Q262..Age),
    .groups = 'drop'  # This option removes the grouping structure afterwards
  )

# Display the table
print(age_summary_sup)
## # A tibble: 94 × 4
##    age_bucket   sup  Mean Median
##    <fct>      <dbl> <dbl>  <dbl>
##  1 Under 18       0  16.5   16.5
##  2 Under 18       2  16.2   16  
##  3 Under 18       3  16.6   16.5
##  4 Under 18       4  16.4   16  
##  5 Under 18       5  16.6   16  
##  6 Under 18       6  16.8   17  
##  7 Under 18       7  16.5   16  
##  8 Under 18       8  16.7   17  
##  9 Under 18       9  16.6   17  
## 10 Under 18      10  16.7   17  
## # ℹ 84 more rows
ggplot(dat7, aes(x = age_bucket, y = prog, fill = age_bucket)) +
  geom_boxplot() +
  labs(title = "progressiveness Scores by Age Group",
       x = "Age Group",
       y = "Score") +
  theme_minimal() +
  scale_fill_brewer(palette = "Paired")

##gender
#liberation
unique(dat7$Q260..Sex)
## [1] 2 1
t.test(dat7$Q260..Sex, dat7$lib, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q260..Sex and dat7$lib
## t = -34.088, df = 1742.2, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -3.556373 -3.169395
## sample estimates:
## mean of x mean of y 
##  1.433806  4.796690
ggplot(dat7, aes(x = factor(Q260..Sex), y = lib)) +
  geom_boxplot() +
  labs(title = "Distribution of liberation scores across genders",
       x = "Gender",
       y = " Score") +
  scale_x_discrete(labels = c("1" = "Male", "2" = "Female")) +
  theme_minimal()

#superiority
t.test(dat7$Q260..Sex, dat7$sup, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q260..Sex and dat7$sup
## t = -86.649, df = 1786.1, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -6.453721 -6.168029
## sample estimates:
## mean of x mean of y 
##  1.433806  7.744681
ggplot(dat7, aes(x = factor(Q260..Sex), y = sup)) +
  geom_boxplot() +
  labs(title = "Distribution of belief in male superiority scores across genders",
       x = "Gender",
       y = " Score") +
  scale_x_discrete(labels = c("1" = "Male", "2" = "Female")) +
  theme_minimal()

#traditional 
t.test(dat7$Q260..Sex, dat7$trad, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q260..Sex and dat7$trad
## t = -99.967, df = 1782.9, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -7.550125 -7.259568
## sample estimates:
## mean of x mean of y 
##  1.433806  8.838652
ggplot(dat7, aes(x = factor(Q260..Sex), y = trad)) +
  geom_boxplot() +
  labs(title = "Distribution of belief in traditional roles scores across genders",
       x = "Gender",
       y = " Score") +
  scale_x_discrete(labels = c("1" = "Male", "2" = "Female")) +
  theme_minimal()

##overall progressivess
t.test(dat7$Q260..Sex, dat7$prog, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q260..Sex and dat7$prog
## t = -117.02, df = 1708, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -20.28053 -19.61190
## sample estimates:
## mean of x mean of y 
##  1.433806 21.380024
ggplot(dat7, aes(x = factor(Q260..Sex), y = prog)) +
  geom_boxplot() +
  labs(title = "Distribution progressiveness scores across genders",
       x = "Gender",
       y = " Score") +
  scale_x_discrete(labels = c("1" = "Male", "2" = "Female")) +
  theme_minimal()

##political leanings 
#liberation 
t.test(dat7$Q240..Left.right.political.scale, dat7$lib, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q240..Left.right.political.scale and dat7$lib
## t = -4.1138, df = 3378.2, p-value = 3.985e-05
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.8273202 -0.2932472
## sample estimates:
## mean of x mean of y 
##  4.236407  4.796690
ggplot(dat7, aes(x = factor(Q240..Left.right.political.scale), y = lib)) +
  geom_boxplot() +
  labs(title = "Distribution of liberation scores across political affiliation",
       x = "Political leanings",
       y = " Score") +
  theme_minimal()

#superiority 
t.test(dat7$Q240..Left.right.political.scale, dat7$sup, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q240..Left.right.political.scale and dat7$sup
## t = -29.522, df = 3153.3, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -3.741277 -3.275271
## sample estimates:
## mean of x mean of y 
##  4.236407  7.744681
ggplot(dat7, aes(x = factor(Q240..Left.right.political.scale), y = sup)) +
  geom_boxplot() +
  labs(title = "Distribution of belief in male superiority scores across political affiliation",
       x = "Political leanings",
       y = " Score") +
  theme_minimal()

#traditional 
t.test(dat7$Q240..Left.right.political.scale, dat7$trad, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q240..Left.right.political.scale and dat7$trad
## t = -38.48, df = 3178.3, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -4.836746 -4.367746
## sample estimates:
## mean of x mean of y 
##  4.236407  8.838652
ggplot(dat7, aes(x = factor(Q240..Left.right.political.scale), y = trad)) +
  geom_boxplot() +
  labs(title = "Distribution of traditional beliefs scores across political affiliation",
       x = "Political leanings",
       y = " Score") +
  theme_minimal()

##progressiveness
t.test(dat7$Q240..Left.right.political.scale, dat7$prog, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q240..Left.right.political.scale and dat7$prog
## t = -88.094, df = 2647.6, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -17.52521 -16.76202
## sample estimates:
## mean of x mean of y 
##  4.236407 21.380024
ggplot(dat7, aes(x = factor(Q240..Left.right.political.scale), y = prog)) +
  geom_boxplot() +
  labs(title = "Distribution of progressivness scores across political affiliation",
       x = "Political leanings",
       y = " Score") +
  theme_minimal()

unique(df$A_YEAR..Year.of.survey)
## [1] 2022
##level of education
#liberation 
t.test(dat7$Q275R..Highest.educational.level..Respondent..recoded.into.3.groups., dat7$lib, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. and dat7$lib
## t = -29.044, df = 1807.6, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -3.087755 -2.697115
## sample estimates:
## mean of x mean of y 
##  1.904255  4.796690
edu_lib <- dat7 %>%
  group_by(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.,lib) %>%
  summarise(
    Mean = mean(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.),
    Median = median(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.),
    .groups = 'drop'  # This option removes the grouping structure afterwards
  )

# Display the table
print(edu_lib)
## # A tibble: 64 × 4
##    Q275R..Highest.educational.level..Respondent..recoded.in…¹   lib  Mean Median
##                                                         <int> <dbl> <dbl>  <dbl>
##  1                                                         -1     5    -1     -1
##  2                                                         -1     6    -1     -1
##  3                                                         -1     9    -1     -1
##  4                                                          1     0     1      1
##  5                                                          1     1     1      1
##  6                                                          1     2     1      1
##  7                                                          1     3     1      1
##  8                                                          1     4     1      1
##  9                                                          1     5     1      1
## 10                                                          1     6     1      1
## # ℹ 54 more rows
## # ℹ abbreviated name:
## #   ¹​Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.
ggplot(dat7, aes(x = factor(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.), y = lib, fill = factor(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.))) +
  geom_boxplot() +
  labs(title = "Liberation Scores by INCOME Group",
       x = "education Group",
       y = "Liberation Score") +
  theme_minimal() +
  scale_fill_brewer(palette = "Paired")

#superiority 
t.test(dat7$Q275R..Highest.educational.level..Respondent..recoded.into.3.groups., dat7$sup, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. and dat7$sup
## t = -78.823, df = 1907, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -5.985742 -5.695109
## sample estimates:
## mean of x mean of y 
##  1.904255  7.744681
edu_sup <- dat7 %>%
  group_by(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.,sup) %>%
  summarise(
    Mean = mean(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.),
    Median = median(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.),
    .groups = 'drop'  # This option removes the grouping structure afterwards
  )

# Display the table
print(edu_sup)
## # A tibble: 46 × 4
##    Q275R..Highest.educational.level..Respondent..recoded.in…¹   sup  Mean Median
##                                                         <int> <dbl> <dbl>  <dbl>
##  1                                                         -1     4    -1     -1
##  2                                                         -1     5    -1     -1
##  3                                                         -1     6    -1     -1
##  4                                                          1     0     1      1
##  5                                                          1     1     1      1
##  6                                                          1     2     1      1
##  7                                                          1     3     1      1
##  8                                                          1     4     1      1
##  9                                                          1     5     1      1
## 10                                                          1     6     1      1
## # ℹ 36 more rows
## # ℹ abbreviated name:
## #   ¹​Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.
ggplot(dat7, aes(x = factor(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.), y = sup, fill = factor(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.))) +
  geom_boxplot() +
  labs(title = "superiority Scores by INCOME Group",
       x = "education Group",
       y = "Score") +
  theme_minimal() +
  scale_fill_brewer(palette = "Paired")

#traditional
t.test(dat7$Q275R..Highest.educational.level..Respondent..recoded.into.3.groups., dat7$trad, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. and dat7$trad
## t = -92.072, df = 1899.7, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -7.082105 -6.786689
## sample estimates:
## mean of x mean of y 
##  1.904255  8.838652
edu_trad <- dat7 %>%
  group_by(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.,trad) %>%
  summarise(
    Mean = mean(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.),
    Median = median(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.),
    .groups = 'drop'  # This option removes the grouping structure afterwards
  )

# Display the table
print(edu_trad)
## # A tibble: 50 × 4
##    Q275R..Highest.educational.level..Respondent..recoded.in…¹  trad  Mean Median
##                                                         <int> <dbl> <dbl>  <dbl>
##  1                                                         -1     5    -1     -1
##  2                                                         -1     6    -1     -1
##  3                                                          1     0     1      1
##  4                                                          1     1     1      1
##  5                                                          1     2     1      1
##  6                                                          1     3     1      1
##  7                                                          1     4     1      1
##  8                                                          1     5     1      1
##  9                                                          1     6     1      1
## 10                                                          1     7     1      1
## # ℹ 40 more rows
## # ℹ abbreviated name:
## #   ¹​Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.
ggplot(dat7, aes(x = factor(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.), y = trad, fill = factor(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.))) +
  geom_boxplot() +
  labs(title = "Traditional roles Scores by INCOME Group",
       x = "education Group",
       y = "Score") +
  theme_minimal() +
  scale_fill_brewer(palette = "Paired")

#overall
t.test(dat7$Q275R..Highest.educational.level..Respondent..recoded.into.3.groups., dat7$prog, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. and dat7$prog
## t = -113.9, df = 1729.7, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -19.81115 -19.14039
## sample estimates:
## mean of x mean of y 
##  1.904255 21.380024
edu_prog <- dat7 %>%
  group_by(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.,prog) %>%
  summarise(
    Mean = mean(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.),
    Median = median(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.),
    .groups = 'drop'  # This option removes the grouping structure afterwards
  )

# Display the table
print(edu_prog)
## # A tibble: 118 × 4
##    Q275R..Highest.educational.level..Respondent..recoded.in…¹  prog  Mean Median
##                                                         <int> <dbl> <dbl>  <dbl>
##  1                                                         -1    15    -1     -1
##  2                                                         -1    17    -1     -1
##  3                                                         -1    19    -1     -1
##  4                                                          1     2     1      1
##  5                                                          1     3     1      1
##  6                                                          1     4     1      1
##  7                                                          1     5     1      1
##  8                                                          1     6     1      1
##  9                                                          1     7     1      1
## 10                                                          1     8     1      1
## # ℹ 108 more rows
## # ℹ abbreviated name:
## #   ¹​Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.
ggplot(dat7, aes(x = factor(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.), y = prog, fill = factor(Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.))) +
  geom_boxplot() +
  labs(title = "Progressiveness Scores by INCOME Group",
       x = "education Group",
       y = "Score") +
  theme_minimal() +
  scale_fill_brewer(palette = "Paired")

##income group 
#liberation 
t.test(dat7$Q288R..Income.level..Recoded., dat7$lib, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q288R..Income.level..Recoded. and dat7$lib
## t = -28.713, df = 1821.7, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -3.060965 -2.669532
## sample estimates:
## mean of x mean of y 
##  1.931442  4.796690
income_lib <- dat7 %>%
  group_by(Q288R..Income.level..Recoded.,lib) %>%
  summarise(
    Mean = mean(Q288R..Income.level..Recoded.),
    Median = median(Q288R..Income.level..Recoded.),
    .groups = 'drop'  # This option removes the grouping structure afterwards
  )

# Display the table
print(income_lib)
## # A tibble: 68 × 4
##    Q288R..Income.level..Recoded.   lib  Mean Median
##                            <int> <dbl> <dbl>  <dbl>
##  1                            -1     0    -1     -1
##  2                            -1     1    -1     -1
##  3                            -1     2    -1     -1
##  4                            -1     3    -1     -1
##  5                            -1     4    -1     -1
##  6                            -1     6    -1     -1
##  7                            -1    18    -1     -1
##  8                            -1    20    -1     -1
##  9                             1     0     1      1
## 10                             1     1     1      1
## # ℹ 58 more rows
ggplot(dat7, aes(x = factor(Q288R..Income.level..Recoded.), y = lib, fill = factor(Q288R..Income.level..Recoded.))) +
  geom_boxplot() +
  labs(title = "Liberation Scores by INCOME Group",
       x = "INCOME Group",
       y = "Liberation Score") +
  theme_minimal() +
  scale_fill_brewer(palette = "Paired")

#superiority 
t.test(dat7$Q288R..Income.level..Recoded., dat7$sup, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q288R..Income.level..Recoded. and dat7$sup
## t = -78.169, df = 1933.1, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -5.959088 -5.667390
## sample estimates:
## mean of x mean of y 
##  1.931442  7.744681
income_sup <- dat7 %>%
  group_by(Q288R..Income.level..Recoded.,sup) %>%
  summarise(
    Mean = mean(Q288R..Income.level..Recoded.),
    Median = median(Q288R..Income.level..Recoded.),
    .groups = 'drop'  # This option removes the grouping structure afterwards
  )

# Display the table
print(income_sup)
## # A tibble: 55 × 4
##    Q288R..Income.level..Recoded.   sup  Mean Median
##                            <int> <dbl> <dbl>  <dbl>
##  1                            -1     2    -1     -1
##  2                            -1     3    -1     -1
##  3                            -1     4    -1     -1
##  4                            -1     5    -1     -1
##  5                            -1     6    -1     -1
##  6                            -1     7    -1     -1
##  7                            -1     8    -1     -1
##  8                            -1     9    -1     -1
##  9                            -1    10    -1     -1
## 10                            -1    12    -1     -1
## # ℹ 45 more rows
ggplot(dat7, aes(x = factor(Q288R..Income.level..Recoded.), y = sup, fill = factor(Q288R..Income.level..Recoded.))) +
  geom_boxplot() +
  labs(title = "superiority Scores by INCOME Group",
       x = "INCOME Group",
       y = "Score") +
  theme_minimal() +
  scale_fill_brewer(palette = "Paired")

#tradition
t.test(dat7$Q288R..Income.level..Recoded., dat7$trad, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q288R..Income.level..Recoded. and dat7$trad
## t = -91.387, df = 1924.9, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -7.055442 -6.758978
## sample estimates:
## mean of x mean of y 
##  1.931442  8.838652
income_trad <- dat7 %>%
  group_by(Q288R..Income.level..Recoded.,trad) %>%
  summarise(
    Mean = mean(Q288R..Income.level..Recoded.),
    Median = median(Q288R..Income.level..Recoded.),
    .groups = 'drop'  # This option removes the grouping structure afterwards
  )

# Display the table
print(income_trad)
## # A tibble: 60 × 4
##    Q288R..Income.level..Recoded.  trad  Mean Median
##                            <int> <dbl> <dbl>  <dbl>
##  1                            -1     0    -1     -1
##  2                            -1     2    -1     -1
##  3                            -1     4    -1     -1
##  4                            -1     5    -1     -1
##  5                            -1     6    -1     -1
##  6                            -1     7    -1     -1
##  7                            -1     8    -1     -1
##  8                            -1     9    -1     -1
##  9                            -1    10    -1     -1
## 10                            -1    11    -1     -1
## # ℹ 50 more rows
ggplot(dat7, aes(x = factor(Q288R..Income.level..Recoded.), y = trad, fill = factor(Q288R..Income.level..Recoded.))) +
  geom_boxplot() +
  labs(title = "Trdaitional role Scores by INCOME Group",
       x = "INCOME Group",
       y = "Score") +
  theme_minimal() +
  scale_fill_brewer(palette = "Paired")

#overall
t.test(dat7$Q288R..Income.level..Recoded., dat7$prog, var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  dat7$Q288R..Income.level..Recoded. and dat7$prog
## t = -113.66, df = 1734.4, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -19.78419 -19.11297
## sample estimates:
## mean of x mean of y 
##  1.931442 21.380024
income_prog <- dat7 %>%
  group_by(Q288R..Income.level..Recoded.,prog) %>%
  summarise(
    Mean = mean(Q288R..Income.level..Recoded.),
    Median = median(Q288R..Income.level..Recoded.),
    .groups = 'drop'  # This option removes the grouping structure afterwards
  )

# Display the table
print(income_prog)
## # A tibble: 133 × 4
##    Q288R..Income.level..Recoded.  prog  Mean Median
##                            <int> <dbl> <dbl>  <dbl>
##  1                            -1     2    -1     -1
##  2                            -1     6    -1     -1
##  3                            -1     8    -1     -1
##  4                            -1     9    -1     -1
##  5                            -1    10    -1     -1
##  6                            -1    12    -1     -1
##  7                            -1    13    -1     -1
##  8                            -1    15    -1     -1
##  9                            -1    16    -1     -1
## 10                            -1    17    -1     -1
## # ℹ 123 more rows
ggplot(dat7, aes(x = factor(Q288R..Income.level..Recoded.), y = prog, fill = factor(Q288R..Income.level..Recoded.))) +
  geom_boxplot() +
  labs(title = "Progressiveness Scores by INCOME Group",
       x = "INCOME Group",
       y = "Score") +
  theme_minimal() +
  scale_fill_brewer(palette = "Paired")

###regressions
##Age
#overall
age_prog<- lm(prog ~ Q262..Age, dat = dat7)
summary(age_prog)
## 
## Call:
## lm(formula = prog ~ Q262..Age, data = dat7)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -20.7357  -5.0112  -0.5881   4.5343  23.5259 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 22.58177    0.40874  55.247  < 2e-16 ***
## Q262..Age   -0.03356    0.01039  -3.231  0.00126 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.974 on 1690 degrees of freedom
## Multiple R-squared:  0.00614,    Adjusted R-squared:  0.005552 
## F-statistic: 10.44 on 1 and 1690 DF,  p-value: 0.001256
ggplot(dat7, aes(x = Q262..Age , y = prog)) +
  geom_point(aes(color = Q262..Age), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of progressiveness Scores on Age",
       x = "Age",
       y = "progress Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red")  # Gradient color based on age
## `geom_smooth()` using formula = 'y ~ x'

#liberation
age_lib<- lm(lib ~ Q262..Age, dat = dat7)
summary(age_lib)
## 
## Call:
## lm(formula = lib ~ Q262..Age, data = dat7)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -5.059 -2.834 -1.880  1.550 15.458 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  5.271048   0.235769  22.357   <2e-16 ***
## Q262..Age   -0.013249   0.005992  -2.211   0.0272 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.023 on 1690 degrees of freedom
## Multiple R-squared:  0.002885,   Adjusted R-squared:  0.002295 
## F-statistic: 4.889 on 1 and 1690 DF,  p-value: 0.02716
ggplot(dat7, aes(x = Q262..Age , y = lib)) +
  geom_point(aes(color = Q262..Age), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of liberation Scores on Age",
       x = "Age",
       y = "liberation Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red")  # Gradient color based on age
## `geom_smooth()` using formula = 'y ~ x'

#superiority 
age_sup<- lm(sup ~ Q262..Age, dat = dat7)
summary(age_sup)
## 
## Call:
## lm(formula = sup ~ Q262..Age, data = dat7)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -8.0645 -1.9999 -0.3216  2.0364  6.8075 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  8.322867   0.172517  48.244  < 2e-16 ***
## Q262..Age   -0.016149   0.004384  -3.683 0.000237 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.944 on 1690 degrees of freedom
## Multiple R-squared:  0.007964,   Adjusted R-squared:  0.007377 
## F-statistic: 13.57 on 1 and 1690 DF,  p-value: 0.0002375
ggplot(dat7, aes(x = Q262..Age , y = sup)) +
  geom_point(aes(color = Q262..Age), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of superiority Scores on Age",
       x = "Age",
       y = "progress Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red")  # Gradient color based on age
## `geom_smooth()` using formula = 'y ~ x'

#traditional roles
age_trad<- lm(trad ~ Q262..Age, dat = dat7)
summary(age_prog)
## 
## Call:
## lm(formula = prog ~ Q262..Age, data = dat7)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -20.7357  -5.0112  -0.5881   4.5343  23.5259 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 22.58177    0.40874  55.247  < 2e-16 ***
## Q262..Age   -0.03356    0.01039  -3.231  0.00126 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.974 on 1690 degrees of freedom
## Multiple R-squared:  0.00614,    Adjusted R-squared:  0.005552 
## F-statistic: 10.44 on 1 and 1690 DF,  p-value: 0.001256
ggplot(dat7, aes(x = Q262..Age , y = trad)) +
  geom_point(aes(color = Q262..Age), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of traditional roles Scores on Age",
       x = "Age",
       y = "progress Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red")  # Gradient color based on age
## `geom_smooth()` using formula = 'y ~ x'

##employment
#overall
employ_prog<- lm(prog ~ Q279..Employment.status, dat = dat7)
summary(employ_prog)
## 
## Call:
## lm(formula = prog ~ Q279..Employment.status, data = dat7)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -20.2660  -4.8591  -0.5626   4.6581  24.1409 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             22.63848    0.36401  62.192  < 2e-16 ***
## Q279..Employment.status -0.29656    0.07594  -3.905 9.78e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.965 on 1690 degrees of freedom
## Multiple R-squared:  0.008944,   Adjusted R-squared:  0.008358 
## F-statistic: 15.25 on 1 and 1690 DF,  p-value: 9.778e-05
ggplot(dat7, aes(x = Q279..Employment.status , y = prog)) +
  geom_point(aes(color = Q279..Employment.status), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of employment roles Scores on Age",
       x = "employment category",
       y = "progress Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red")  # Gradient color based on age
## `geom_smooth()` using formula = 'y ~ x'

#liberation
employ_lib<- lm(lib ~ Q279..Employment.status, dat = dat7)
summary(employ_lib)
## 
## Call:
## lm(formula = lib ~ Q279..Employment.status, data = dat7)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -6.241 -2.588 -1.762  1.687 15.687 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              5.96568    0.20810  28.667  < 2e-16 ***
## Q279..Employment.status -0.27548    0.04341  -6.346 2.84e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.982 on 1690 degrees of freedom
## Multiple R-squared:  0.02327,    Adjusted R-squared:  0.02269 
## F-statistic: 40.27 on 1 and 1690 DF,  p-value: 2.839e-10
ggplot(dat7, aes(x = Q279..Employment.status , y = lib)) +
  geom_point(aes(color = Q279..Employment.status), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of employment roles Scores on Age",
       x = "Age",
       y = "liberation Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red")  # Gradient color based on age
## `geom_smooth()` using formula = 'y ~ x'

#superiority 
employ_sup<- lm(sup ~ Q279..Employment.status, dat = dat7)
summary(employ_sup)
## 
## Call:
## lm(formula = sup ~ Q279..Employment.status, data = dat7)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -7.827 -1.805 -0.674  2.217  6.326 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              7.65226    0.15445  49.545   <2e-16 ***
## Q279..Employment.status  0.02178    0.03222   0.676    0.499    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.955 on 1690 degrees of freedom
## Multiple R-squared:  0.0002703,  Adjusted R-squared:  -0.0003213 
## F-statistic: 0.4569 on 1 and 1690 DF,  p-value: 0.4992
ggplot(dat7, aes(x = Q279..Employment.status , y = sup)) +
  geom_point(aes(color = Q279..Employment.status), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of employment roles Scores on Age",
       x = "Age",
       y = "superiority Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red")  # Gradient color based on age
## `geom_smooth()` using formula = 'y ~ x'

#traditional 
employ_trad<- lm(trad ~ Q279..Employment.status, dat = dat7)
summary(employ_trad)
## 
## Call:
## lm(formula = trad ~ Q279..Employment.status, data = dat7)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -8.8062 -1.9348  0.1081  2.1081  7.3224 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              9.02053    0.15709  57.421   <2e-16 ***
## Q279..Employment.status -0.04286    0.03277  -1.308    0.191    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.006 on 1690 degrees of freedom
## Multiple R-squared:  0.001011,   Adjusted R-squared:  0.00042 
## F-statistic:  1.71 on 1 and 1690 DF,  p-value: 0.1911
ggplot(dat7, aes(x = Q279..Employment.status , y = trad)) +
  geom_point(aes(color = Q279..Employment.status), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of employment roles Scores on Age",
       x = "Age",
       y = "traditional Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red")  # Gradient color based on age
## `geom_smooth()` using formula = 'y ~ x'

##Sex
#OVERALL
gender_prog<- lm(prog ~ Q260..Sex, dat = dat7)
summary(gender_prog)
## 
## Call:
## lm(formula = prog ~ Q260..Sex, data = dat7)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -21.0157  -4.8956  -0.8556   4.1444  23.1444 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  20.1757     0.5197  38.823   <2e-16 ***
## Q260..Sex     0.8399     0.3426   2.452   0.0143 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.983 on 1690 degrees of freedom
## Multiple R-squared:  0.003545,   Adjusted R-squared:  0.002955 
## F-statistic: 6.012 on 1 and 1690 DF,  p-value: 0.01431
#liberation
gender_lib<- lm(lib ~ Q260..Sex, dat = dat7)
summary(gender_lib)
## 
## Call:
## lm(formula = lib ~ Q260..Sex, data = dat7)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -5.006 -3.006 -2.006  1.477 15.477 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   5.4894     0.2993  18.342   <2e-16 ***
## Q260..Sex    -0.4831     0.1973  -2.449   0.0144 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.022 on 1690 degrees of freedom
## Multiple R-squared:  0.003536,   Adjusted R-squared:  0.002946 
## F-statistic: 5.997 on 1 and 1690 DF,  p-value: 0.01443
#superiortiy 
gender_sup<- lm(sup ~ Q260..Sex, dat = dat7)
summary(gender_sup)
## 
## Call:
## lm(formula = sup ~ Q260..Sex, data = dat7)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -8.1703 -2.1703 -0.4186  1.8297  6.5814 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   6.6669     0.2182  30.557  < 2e-16 ***
## Q260..Sex     0.7517     0.1438   5.227 1.94e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.932 on 1690 degrees of freedom
## Multiple R-squared:  0.01591,    Adjusted R-squared:  0.01533 
## F-statistic: 27.32 on 1 and 1690 DF,  p-value: 1.938e-07
#traditional
gender_trad<- lm(trad ~ Q260..Sex, dat = dat7)
summary(gender_trad)
## 
## Call:
## lm(formula = trad ~ Q260..Sex, data = dat7)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -9.1621 -2.1621  0.4092  1.8379  7.4092 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   8.0195     0.2228   36.00  < 2e-16 ***
## Q260..Sex     0.5713     0.1469    3.89 0.000104 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.994 on 1690 degrees of freedom
## Multiple R-squared:  0.008876,   Adjusted R-squared:  0.008289 
## F-statistic: 15.13 on 1 and 1690 DF,  p-value: 0.000104
##Income
#OVERALL
income_proge<- lm(prog ~ Q288R..Income.level..Recoded., dat = dat7)
summary(income_proge)
## 
## Call:
## lm(formula = prog ~ Q288R..Income.level..Recoded., data = dat7)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -21.4845  -4.9600  -0.4845   4.5155  23.5155 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                    18.4356     0.4414   41.77  < 2e-16 ***
## Q288R..Income.level..Recoded.   1.5245     0.2114    7.21 8.41e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.891 on 1690 degrees of freedom
## Multiple R-squared:  0.02984,    Adjusted R-squared:  0.02927 
## F-statistic: 51.98 on 1 and 1690 DF,  p-value: 8.406e-13
ggplot(dat7, aes(x =  Q288R..Income.level..Recoded. , y = prog)) +
  geom_point(aes(color = Q288R..Income.level..Recoded.), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of income groups and progressiveness",
       x = "income",
       y = "progress Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red")  
## `geom_smooth()` using formula = 'y ~ x'

#liberation
income_libe<- lm(lib ~ Q288R..Income.level..Recoded., dat = dat7)
summary(income_libe)
## 
## Call:
## lm(formula = lib ~ Q288R..Income.level..Recoded., data = dat7)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -5.557 -2.845 -1.845  1.866 17.288 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                     3.4229     0.2555  13.395  < 2e-16 ***
## Q288R..Income.level..Recoded.   0.7113     0.1224   5.811 7.41e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.989 on 1690 degrees of freedom
## Multiple R-squared:  0.01959,    Adjusted R-squared:  0.01901 
## F-statistic: 33.77 on 1 and 1690 DF,  p-value: 7.413e-09
ggplot(dat7, aes(x =  Q288R..Income.level..Recoded. , y = lib)) +
  geom_point(aes(color = Q288R..Income.level..Recoded.), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of employment roles Scores on Age",
       x = "income",
       y = "Liberation Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red") 
## `geom_smooth()` using formula = 'y ~ x'

#superiortiy 
income_supe<- lm(sup ~ Q288R..Income.level..Recoded., dat = dat7)
summary(income_supe)
## 
## Call:
## lm(formula = sup ~ Q288R..Income.level..Recoded., data = dat7)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -8.0479 -2.0479 -0.4804  2.2359  7.0872 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                    7.19658    0.18877  38.123  < 2e-16 ***
## Q288R..Income.level..Recoded.  0.28378    0.09043   3.138  0.00173 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.947 on 1690 degrees of freedom
## Multiple R-squared:  0.005794,   Adjusted R-squared:  0.005205 
## F-statistic: 9.848 on 1 and 1690 DF,  p-value: 0.001729
ggplot(dat7, aes(x =  Q288R..Income.level..Recoded. , y = sup)) +
  geom_point(aes(color = Q288R..Income.level..Recoded.), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of income on superiority",
       x = "income",
       y = "Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red") 
## `geom_smooth()` using formula = 'y ~ x'

#traditional
income_trade<- lm(trad ~ Q288R..Income.level..Recoded., dat = dat7)
summary(income_trade)
## 
## Call:
## lm(formula = trad ~ Q288R..Income.level..Recoded., data = dat7)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -8.8749 -1.8749  0.1251  2.1251  7.6545 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                    7.81608    0.19075  40.975  < 2e-16 ***
## Q288R..Income.level..Recoded.  0.52943    0.09137   5.794 8.17e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.978 on 1690 degrees of freedom
## Multiple R-squared:  0.01948,    Adjusted R-squared:  0.0189 
## F-statistic: 33.57 on 1 and 1690 DF,  p-value: 8.171e-09
ggplot(dat7, aes(x =  Q288R..Income.level..Recoded. , y = trad)) +
  geom_point(aes(color = Q288R..Income.level..Recoded.), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of income on traditional",
       x = "income",
       y = "Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red")
## `geom_smooth()` using formula = 'y ~ x'

##education
#OVERALL
educa_prog<- lm(prog ~ Q275R..Highest.educational.level..Respondent..recoded.into.3.groups., dat = dat7)
summary(educa_prog)
## 
## Call:
## lm(formula = prog ~ Q275R..Highest.educational.level..Respondent..recoded.into.3.groups., 
##     data = dat7)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -21.572  -4.572  -0.572   4.428  21.428 
## 
## Coefficients:
##                                                                      Estimate
## (Intercept)                                                           17.5623
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.   2.0048
##                                                                      Std. Error
## (Intercept)                                                              0.4544
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.     0.2221
##                                                                      t value
## (Intercept)                                                           38.649
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.   9.027
##                                                                      Pr(>|t|)
## (Intercept)                                                            <2e-16
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.   <2e-16
##                                                                         
## (Intercept)                                                          ***
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.833 on 1690 degrees of freedom
## Multiple R-squared:  0.04599,    Adjusted R-squared:  0.04543 
## F-statistic: 81.48 on 1 and 1690 DF,  p-value: < 2.2e-16
ggplot(dat7, aes(x =  Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. , y = prog)) +
  geom_point(aes(color = Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "regression of income and progressive scores",
       x = "income",
       y = "progress Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red")  
## `geom_smooth()` using formula = 'y ~ x'

#liberation
educa_lib<- lm(lib ~ Q275R..Highest.educational.level..Respondent..recoded.into.3.groups., dat = dat7)
summary(educa_lib)
## 
## Call:
## lm(formula = lib ~ Q275R..Highest.educational.level..Respondent..recoded.into.3.groups., 
##     data = dat7)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -5.375 -2.847 -1.847  1.680 15.680 
## 
## Coefficients:
##                                                                      Estimate
## (Intercept)                                                            3.7926
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.   0.5273
##                                                                      Std. Error
## (Intercept)                                                              0.2666
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.     0.1303
##                                                                      t value
## (Intercept)                                                           14.225
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.   4.046
##                                                                      Pr(>|t|)
## (Intercept)                                                           < 2e-16
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. 5.45e-05
##                                                                         
## (Intercept)                                                          ***
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.009 on 1690 degrees of freedom
## Multiple R-squared:  0.009593,   Adjusted R-squared:  0.009007 
## F-statistic: 16.37 on 1 and 1690 DF,  p-value: 5.446e-05
ggplot(dat7, aes(x =  Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. , y = lib)) +
  geom_point(aes(color = Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of education roles Scores on liberation",
       x = "education",
       y = "Liberation Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red") 
## `geom_smooth()` using formula = 'y ~ x'

#superiortiy 
educa_sup<- lm(sup ~ Q275R..Highest.educational.level..Respondent..recoded.into.3.groups., dat = dat7)
summary(educa_sup)
## 
## Call:
## lm(formula = sup ~ Q275R..Highest.educational.level..Respondent..recoded.into.3.groups., 
##     data = dat7)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -7.8159 -1.8159 -0.0724  2.1841  6.9276 
## 
## Coefficients:
##                                                                      Estimate
## (Intercept)                                                           6.32902
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.  0.74342
##                                                                      Std. Error
## (Intercept)                                                             0.19302
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.    0.09435
##                                                                      t value
## (Intercept)                                                            32.79
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.    7.88
##                                                                      Pr(>|t|)
## (Intercept)                                                           < 2e-16
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. 5.84e-15
##                                                                         
## (Intercept)                                                          ***
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.903 on 1690 degrees of freedom
## Multiple R-squared:  0.03544,    Adjusted R-squared:  0.03487 
## F-statistic: 62.09 on 1 and 1690 DF,  p-value: 5.837e-15
ggplot(dat7, aes(x =  Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. , y = sup)) +
  geom_point(aes(color = Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of income on superiority",
       x = "education",
       y = "Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red") 
## `geom_smooth()` using formula = 'y ~ x'

#traditional
educa_trade<- lm(trad ~ Q275R..Highest.educational.level..Respondent..recoded.into.3.groups., dat = dat7)
summary(educa_trade)
## 
## Call:
## lm(formula = trad ~ Q275R..Highest.educational.level..Respondent..recoded.into.3.groups., 
##     data = dat7)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -8.9089 -1.9089  0.0911  2.0911  7.8252 
## 
## Coefficients:
##                                                                      Estimate
## (Intercept)                                                            7.4406
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.   0.7341
##                                                                      Std. Error
## (Intercept)                                                              0.1966
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.     0.0961
##                                                                      t value
## (Intercept)                                                           37.844
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.   7.639
##                                                                      Pr(>|t|)
## (Intercept)                                                           < 2e-16
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. 3.64e-14
##                                                                         
## (Intercept)                                                          ***
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.957 on 1690 degrees of freedom
## Multiple R-squared:  0.03338,    Adjusted R-squared:  0.03281 
## F-statistic: 58.36 on 1 and 1690 DF,  p-value: 3.635e-14
ggplot(dat7, aes(x =  Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. , y = trad)) +
  geom_point(aes(color = Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of education on traditional",
       x = "income",
       y = "Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red")
## `geom_smooth()` using formula = 'y ~ x'

##political leaning
#OVERALL
pol_prog<- lm(prog ~ Q240..Left.right.political.scale, dat = dat7)
summary(pol_prog)
## 
## Call:
## lm(formula = prog ~ Q240..Left.right.political.scale, data = dat7)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -22.7727  -4.8491  -0.7727   4.5197  25.1509 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                       20.1415     0.2480  81.215  < 2e-16 ***
## Q240..Left.right.political.scale   0.2924     0.0431   6.782 1.63e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.903 on 1690 degrees of freedom
## Multiple R-squared:  0.0265, Adjusted R-squared:  0.02592 
## F-statistic:    46 on 1 and 1690 DF,  p-value: 1.628e-11
ggplot(dat7, aes(x =  Q240..Left.right.political.scale , y = prog)) +
  geom_point(aes(color = Q240..Left.right.political.scale), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of political leanings Scores on Age",
       x = "leanings",
       y = "progress Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red")  
## `geom_smooth()` using formula = 'y ~ x'

#liberation
pol_lib<- lm(lib ~ Q240..Left.right.political.scale, dat = dat7)
summary(pol_lib)
## 
## Call:
## lm(formula = lib ~ Q240..Left.right.political.scale, data = dat7)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -5.935 -2.947 -1.762  1.855 15.843 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        3.9599     0.1421  27.870  < 2e-16 ***
## Q240..Left.right.political.scale   0.1975     0.0247   7.999 2.31e-15 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.955 on 1690 degrees of freedom
## Multiple R-squared:  0.03648,    Adjusted R-squared:  0.03591 
## F-statistic: 63.98 on 1 and 1690 DF,  p-value: 2.313e-15
ggplot(dat7, aes(x =  Q240..Left.right.political.scale , y = lib)) +
  geom_point(aes(color = Q240..Left.right.political.scale), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of education roles Scores on liberation",
       x = "leanings",
       y = "Liberation Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red") 
## `geom_smooth()` using formula = 'y ~ x'

#superiortiy 
pol_sup<- lm(sup ~ Q240..Left.right.political.scale, dat = dat7)
summary(pol_sup)
## 
## Call:
## lm(formula = sup ~ Q240..Left.right.political.scale, data = dat7)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -7.755 -1.755 -0.735  2.245  6.267 
## 
## Coefficients:
##                                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                       7.753250   0.106186   73.02   <2e-16 ***
## Q240..Left.right.political.scale -0.002023   0.018456   -0.11    0.913    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.955 on 1690 degrees of freedom
## Multiple R-squared:  7.108e-06,  Adjusted R-squared:  -0.0005846 
## F-statistic: 0.01201 on 1 and 1690 DF,  p-value: 0.9127
ggplot(dat7, aes(x =  Q240..Left.right.political.scale , y = sup)) +
  geom_point(aes(color = Q240..Left.right.political.scale), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of income on superiority",
       x = "leanings",
       y = "Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red") 
## `geom_smooth()` using formula = 'y ~ x'

#traditional
pol_trad<- lm(trad ~ Q240..Left.right.political.scale, dat = dat7)
summary(educa_trade)
## 
## Call:
## lm(formula = trad ~ Q275R..Highest.educational.level..Respondent..recoded.into.3.groups., 
##     data = dat7)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -8.9089 -1.9089  0.0911  2.0911  7.8252 
## 
## Coefficients:
##                                                                      Estimate
## (Intercept)                                                            7.4406
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.   0.7341
##                                                                      Std. Error
## (Intercept)                                                              0.1966
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.     0.0961
##                                                                      t value
## (Intercept)                                                           37.844
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups.   7.639
##                                                                      Pr(>|t|)
## (Intercept)                                                           < 2e-16
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. 3.64e-14
##                                                                         
## (Intercept)                                                          ***
## Q275R..Highest.educational.level..Respondent..recoded.into.3.groups. ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.957 on 1690 degrees of freedom
## Multiple R-squared:  0.03338,    Adjusted R-squared:  0.03281 
## F-statistic: 58.36 on 1 and 1690 DF,  p-value: 3.635e-14
ggplot(dat7, aes(x =  Q240..Left.right.political.scale , y = trad)) +
  geom_point(aes(color = Q240..Left.right.political.scale), alpha = 0.6) +  # Points with transparency
  geom_smooth(method = "lm", color = "blue", se = TRUE) +  # Regression line with confidence interval
  labs(title = "Linear Regression of education on traditional",
       x = "leanings",
       y = "Score") +
  theme_minimal() +
  scale_color_gradient(low = "yellow", high = "red")
## `geom_smooth()` using formula = 'y ~ x'