knitr::opts_chunk$set(echo = TRUE)
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.0.4
## 
## 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(readr)
library(haven)
library(ggthemes)
## Warning: package 'ggthemes' was built under R version 4.0.5
library(rstatix)
## Warning: package 'rstatix' was built under R version 4.0.5
## 
## Attaching package: 'rstatix'
## The following object is masked from 'package:stats':
## 
##     filter
library(esquisse)
library(haven)
library(vtable)
## Warning: package 'vtable' was built under R version 4.0.5
## Loading required package: kableExtra
## Warning: package 'kableExtra' was built under R version 4.0.5
## 
## Attaching package: 'kableExtra'
## The following object is masked from 'package:dplyr':
## 
##     group_rows
library(ggplot2)
library(purrr)


data <- read.csv("A:/Angira/USFCA/Altruism/Rural data analysis/(IN) - Giver Motives Across Cultures - Rural Group_June 22, 2022_10.27.csv")
head(data)
##          StartDate          EndDate     Status    IPAddress Progress
## 1 19-06-2022 22:48 19-06-2022 23:14 IP Address  180.94.32.1      100
## 2 19-06-2022 20:32 19-06-2022 23:14 IP Address  180.94.32.1      100
## 3 19-06-2022 22:50 19-06-2022 23:17 IP Address  180.94.32.1      100
## 4 19-06-2022 22:49 19-06-2022 23:23 IP Address  180.94.32.1      100
## 5 19-06-2022 22:49 19-06-2022 23:25 IP Address  180.94.32.1      100
## 6 19-06-2022 22:46 19-06-2022 23:28 IP Address 47.15.39.239      100
##   Duration..in.seconds. Finished     RecordedDate        ResponseId
## 1                  1578     TRUE 19-06-2022 23:14 R_1PRwjXJmafKc7U8
## 2                  9700     TRUE 19-06-2022 23:14 R_1jBrtRBRpOUJbhr
## 3                  1640     TRUE 19-06-2022 23:18 R_VPfJPunqmq4J25H
## 4                  2049     TRUE 19-06-2022 23:23 R_28ORetXK7x7irvb
## 5                  2126     TRUE 19-06-2022 23:25 R_1nTmq5lJ4w1bHuo
## 6                  2503     TRUE 19-06-2022 23:28 R_DA98a8T0Lmj2oFj
##   RecipientLastName RecipientFirstName RecipientEmail ExternalReference
## 1                NA                 NA             NA                NA
## 2                NA                 NA             NA                NA
## 3                NA                 NA             NA                NA
## 4                NA                 NA             NA                NA
## 5                NA                 NA             NA                NA
## 6                NA                 NA             NA                NA
##   LocationLatitude LocationLongitude DistributionChannel UserLanguage
## 1          29.4742           77.7027           anonymous           EN
## 2          29.4742           77.7027           anonymous           EN
## 3          29.4742           77.7027           anonymous           EN
## 4          29.4742           77.7027           anonymous           EN
## 5          29.4742           77.7027           anonymous           EN
## 6          22.5180           88.3832           anonymous           EN
##   Q_RecaptchaScore Q_RelevantIDDuplicate Q_RelevantIDDuplicateScore
## 1                1                  TRUE                        100
## 2                1                  TRUE                        100
## 3                1                  TRUE                        100
## 4                1                  TRUE                        100
## 5                1                  TRUE                        100
## 6               NA                    NA                         NA
##   Q_RelevantIDFraudScore Q_RelevantIDLastStartDate       Country_Origin
## 1                      0          18-06-2022 06:49 India (भारत)
## 2                      0          15-06-2022 18:52 India (भारत)
## 3                      0          17-06-2022 13:21 India (भारत)
## 4                      0          19-06-2022 06:28 India (भारत)
## 5                      0          19-06-2022 06:27 India (भारत)
## 6                     NA                           India (भारत)
##         Country_living
## 1 India (भारत)
## 2 India (भारत)
## 3 India (भारत)
## 4 India (भारत)
## 5 India (भारत)
## 6 India (भारत)
##                                                       Consent
## 1 Yes, I consent मà¥\201à¤\235े भाग लेना हà¥\210  
## 2 Yes, I consent मà¥\201à¤\235े भाग लेना हà¥\210  
## 3 Yes, I consent मà¥\201à¤\235े भाग लेना हà¥\210  
## 4 Yes, I consent मà¥\201à¤\235े भाग लेना हà¥\210  
## 5 Yes, I consent मà¥\201à¤\235े भाग लेना हà¥\210  
## 6 Yes, I consent मà¥\201à¤\235े भाग लेना हà¥\210  
##                                                                         AttentionCheck
## 1 I canâ\200\231t promise either way हम वादा नहà¥\200ं कर सकà¥\215ते
## 2                                                                Yes, I will हाà¤\201
## 3                                                                Yes, I will हाà¤\201
## 4                                                                Yes, I will हाà¤\201
## 5                                                                Yes, I will हाà¤\201
## 6                                                                Yes, I will हाà¤\201
##                     Residential.Area Residential.Live Age
## 1 Rural गà¥\215राम/जिला    Yes हाà¤\201  50
## 2 Rural गà¥\215राम/जिला    Yes हाà¤\201  75
## 3 Rural गà¥\215राम/जिला  No नहà¥\200ं  70
## 4 Rural गà¥\215राम/जिला  No नहà¥\200ं  59
## 5 Rural गà¥\215राम/जिला    Yes हाà¤\201  60
## 6 Rural गà¥\215राम/जिला    Yes हाà¤\201  35
##                                       ObjectiveSES_2         ObjectiveSES_1
## 1 Less than high school degree (12th से कम )   Less than INR 10,000
## 2 Less than high school degree (12th से कम )   Less than INR 10,000
## 3 Less than high school degree (12th से कम )   Less than INR 10,000
## 4 Less than high school degree (12th से कम )   Less than INR 10,000
## 5 Less than high school degree (12th से कम )   Less than INR 10,000
## 6 Less than high school degree (12th से कम ) INR 10,000 -INR 30,000
##                      Gender Gender_3_TEXT         Race Race_7_TEXT
## 1 Female सà¥\215तà¥\215रà¥\200            NA Indian/Asian            
## 2      Male पà¥\201रà¥\201ष            NA Indian/Asian            
## 3 Female सà¥\215तà¥\215रà¥\200            NA Indian/Asian            
## 4 Female सà¥\215तà¥\215रà¥\200            NA Indian/Asian            
## 5 Female सà¥\215तà¥\215रà¥\200            NA Indian/Asian            
## 6 Female सà¥\215तà¥\215रà¥\200            NA Indian/Asian            
##                                                                                                                                                             children.
## 1 Yes (if yes, please list their age and gender(s)) हाà¤\201 (कृपया बचà¥\215चों कà¥\200 उमà¥\215र और लिंग नà¥\200चे लिखे):
## 2 Yes (if yes, please list their age and gender(s)) हाà¤\201 (कृपया बचà¥\215चों कà¥\200 उमà¥\215र और लिंग नà¥\200चे लिखे):
## 3 Yes (if yes, please list their age and gender(s)) हाà¤\201 (कृपया बचà¥\215चों कà¥\200 उमà¥\215र और लिंग नà¥\200चे लिखे):
## 4 Yes (if yes, please list their age and gender(s)) हाà¤\201 (कृपया बचà¥\215चों कà¥\200 उमà¥\215र और लिंग नà¥\200चे लिखे):
## 5 Yes (if yes, please list their age and gender(s)) हाà¤\201 (कृपया बचà¥\215चों कà¥\200 उमà¥\215र और लिंग नà¥\200चे लिखे):
## 6 Yes (if yes, please list their age and gender(s)) हाà¤\201 (कृपया बचà¥\215चों कà¥\200 उमà¥\215र और लिंग नà¥\200चे लिखे):
##        children._1_TEXT                           family_size
## 1                     3 small छोटा परिवार
## 2                     1 small छोटा परिवार
## 3  3boys 40age 1girl 30   large बड़ा परिवार 
## 4          2 boy 1 girl   large बड़ा परिवार 
## 5       2 ladki 1 ladka   large बड़ा परिवार 
## 6 (2-B25,19)2- G(26-20)   large बड़ा परिवार 
##                                        Political_orient
## 1                     Yes, a little थोड़ा सा
## 2                     Yes, a little थोड़ा सा
## 3 No. Absolutely not बिलà¥\215कà¥\201ल नहà¥\200ं
## 4                     Yes, a little थोड़ा सा
## 5                     Yes, a little थोड़ा सा
## 6                           No, not really नहà¥\200ं
##                                                                          PoliticalParty
## 1          against protesting पà¥\215रदरà¥\215शन के विरोध में
## 2          against protesting पà¥\215रदरà¥\215शन के विरोध में
## 3 in support of protesting पà¥\215रदरà¥\215शन के समरà¥\215थन में
## 4 in support of protesting पà¥\215रदरà¥\215शन के समरà¥\215थन में
## 5          against protesting पà¥\215रदरà¥\215शन के विरोध में
## 6          against protesting पà¥\215रदरà¥\215शन के विरोध में
##                            Political_Strength
## 1 Strongly बोहोत जà¥\215यादा
## 2              Not very strongly थोड़ा
## 3              Not very strongly थोड़ा
## 4              Not very strongly थोड़ा
## 5              Not very strongly थोड़ा
## 6 Strongly बोहोत जà¥\215यादा
##                                                 Tax_importance
## 1      Not at all important बिलà¥\215कà¥\201ल नहà¥\200ं
## 2    Moderately important थोड़ा जरूरà¥\200  हà¥\210
## 3 Slightly important बहà¥\201त थोड़ा ज़रूरà¥\200
## 4                        Very important ज़रूरà¥\200 हà¥\210
## 5                        Very important ज़रूरà¥\200 हà¥\210
## 6      Not at all important बिलà¥\215कà¥\201ल नहà¥\200ं
##                                      Religion                   Caste
## 1 Agnostic or atheist (नासà¥\215तिक) General-Other religions
## 2                  Hindu (हिनà¥\215दू)    Scheduled Caste (SC)
## 3                  Hindu (हिनà¥\215दू)    Scheduled Caste (SC)
## 4                  Hindu (हिनà¥\215दू)    Scheduled Caste (SC)
## 5                  Hindu (हिनà¥\215दू)    Scheduled Caste (SC)
## 6 Agnostic or atheist (नासà¥\215तिक)    Scheduled Tribe (ST)
##   Enjoy_activities_1 Enjoy_activities_2 Enjoy_activities_3 Enjoy_activities_4
## 1                  5                  1                  4                  2
## 2                  6                  2                  3                  1
## 3                  2                  7                  6                  5
## 4                  6                  3                  2                  1
## 5                  4                  3                  2                  1
## 6                  7                  4                  2                  1
##   Enjoy_activities_5 Enjoy_activities_6 Enjoy_activities_7 PersonalExperience_1
## 1                  6                  7                  3                    3
## 2                  4                  7                  5                    8
## 3                  1                  4                  3                    8
## 4                  4                  7                  5                    9
## 5                  6                  5                  7                    5
## 6                  3                  6                  5                    5
##   PersonalExperience_2 PersonalExperience_3 PersonalExperience_4
## 1                    2                    8                    7
## 2                    3                    4                    7
## 3                    7                    4                    5
## 4                    1                    4                    7
## 5                    8                    2                    9
## 6                    4                    7                    2
##   PersonalExperience_5 PersonalExperience_6 PersonalExperience_7
## 1                    4                    5                    1
## 2                    6                    5                    1
## 3                    9                    2                    1
## 4                    6                    5                    3
## 5                    7                    3                    1
## 6                    6                    9                    1
##   PersonalExperience_8 PersonalExperience_9 PassionProblem_1 PassionProblem_2
## 1                    9                    6                5                4
## 2                    2                    9                6                5
## 3                    6                    3                7                6
## 4                    2                    8                3                5
## 5                    4                    6                3                6
## 6                    8                    3                4                2
##   PassionProblem_3 PassionProblem_4 PassionProblem_5 PassionProblem_12
## 1                3                1                6                 2
## 2                1                3                4                 7
## 3                2                1                3                 5
## 4                6                1                2                 7
## 5                2                1                5                 7
## 6                5                1                3                 6
##   PassionProblem_13 Q86_First.Click Q86_Last.Click Q86_Page.Submit
## 1                 7           0.948          2.278          41.649
## 2                 2           2.223         15.928          16.509
## 3                 4           2.197         24.113          24.981
## 4                 4           0.722         56.349          56.993
## 5                 4           1.036         26.726          27.305
## 6                 7           3.807         29.873          30.740
##   Q86_Click.Count                                    GI_check1 GI_check2
## 1               2 Yes, they represent real charities हाà¤\201 Charity A
## 2               7 Yes, they represent real charities हाà¤\201 Charity A
## 3               9 Yes, they represent real charities हाà¤\201 Charity A
## 4               9 Yes, they represent real charities हाà¤\201 Charity A
## 5              14 Yes, they represent real charities हाà¤\201 Charity A
## 6               4 Yes, they represent real charities हाà¤\201 Charity A
##   GI_check3 CG_timing_First.Click CG_timing_Last.Click CG_timing_Page.Submit
## 1 Charity B                 1.041               50.077                50.975
## 2 Charity B                15.529               24.564                25.100
## 3 Charity B                 0.035               12.985                26.925
## 4 Charity B                16.880               45.217                46.087
## 5 Charity B                 2.017               39.413                40.063
## 6 Charity B                 2.263               31.126                31.821
##   CG_timing_Click.Count Char_Community_1 Char_Community_2 Char_Caste._1
## 1                     7               10               90            10
## 2                     3               50               50            80
## 3                    14               10               90            10
## 4                     8               70               30            70
## 5                    10               70               30            50
## 6                    12               50               50            50
##   Char_Caste._2 Char_Country_1 Char_Country_2 Char_Ideology_1 Char_Ideology_2
## 1            90             10             90              10              90
## 2            20             60             40              50              50
## 3            90             10             90              40              60
## 4            30             50             50              50              50
## 5            50             40             60              30              70
## 6            50             40             60              20              80
##   Char_Religion_1 Char_Religion_2 Char_Generation_1 Char_Generation_2
## 1              10              90                10                90
## 2              50              50                60                40
## 3              50              50                50                50
## 4              80              20                50                50
## 5              50              50                50                50
## 6              40              60                50                50
##   Char_Species_1 Char_Species_2 Char_CausePriority_1 Char_CausePriority_2
## 1             10             90                   10                   90
## 2             60             40                   50                   50
## 3             20             80                   40                   60
## 4             70             30                   90                   10
## 5             50             50                   30                   70
## 6             40             60                   40                   60
##   Char_CausePassion_1 Char_CausePassion_2 Norms_timing_First.Click
## 1                  10                  90                    0.706
## 2                  70                  30                    2.019
## 3                  50                  50                    1.322
## 4                  30                  70                    1.035
## 5                  30                  70                    0.812
## 6                  80                  20                    1.039
##   Norms_timing_Last.Click Norms_timing_Page.Submit Norms_timing_Click.Count
## 1                  16.518                   17.501                        6
## 2                  40.579                   41.437                        3
## 3                  14.340                   18.022                        7
## 4                  13.175                   16.201                       10
## 5                  28.476                   39.976                       10
## 6                  30.215                   31.251                        8
##   Norm_Community_1 Norm_Community_2 Norm_Caste_1 Norm_Caste_2 Norm_Country_1
## 1               10               90           10           90             10
## 2               50               50           80           20             70
## 3               50               50           10           90             10
## 4               90               10           80           20             50
## 5               80               20           50           50             50
## 6               50               50           50           50             50
##   Norm_Country_2 Norm_Ideology_1 Norm_Ideology_2 Norm_Religion_1
## 1             90              10              90              10
## 2             30              50              50              80
## 3             90              20              80              10
## 4             50              90              10              80
## 5             50              30              70              50
## 6             50              10              90              60
##   Norm_Religion_2 Norm_Generation_1 Norm_Generation_2 Norm_Species_1
## 1              90                10                90             10
## 2              20                60                40             70
## 3              90                50                50             40
## 4              20                80                20             90
## 5              50                50                50             30
## 6              40                90                10             50
##   Norm_Species_2 Norm_CausPriority_1 Norm_CausPriority_2 Norm_CausePassion_1
## 1             90                  10                  90                  10
## 2             30                  60                  40                  70
## 3             60                  40                  60                  50
## 4             10                  80                  20                  70
## 5             70                  30                  70                  70
## 6             50                  50                  50                  50
##   Norm_CausePassion_2 Char_Generosity N_Generosity2 Anika William
## 1                  90             700           700    20      80
## 2                  30            4000          3000  4000    4000
## 3                  50            2000           500  1000    1000
## 4                  30            2000          3000  1000    1000
## 5                  30            3000          3000  1500    1500
## 6                  50            4000          4500  3000    1000
##                                    ObjectiveSES_3
## 1 Less than high school degree (12 से कम)
## 2 Less than high school degree (12 से कम)
## 3 Less than high school degree (12 से कम)
## 4 Less than high school degree (12 से कम)
## 5 Less than high school degree (12 से कम)
## 6 Less than high school degree (12 से कम)
##                                 ObjectiveSES_4
## 1 Less than high school degree (12 से kam)
## 2 Less than high school degree (12 से kam)
## 3 Less than high school degree (12 से kam)
## 4 Less than high school degree (12 से kam)
## 5 Less than high school degree (12 से kam)
## 6 Less than high school degree (12 से kam)
##                                                   SubjectiveSES_1
## 1       Upper-middle class ऊपरà¥\200 मधà¥\215य वरà¥\215ग
## 2                        Lower class निमà¥\215न वरà¥\215ग
## 3 Lower-middle class निमà¥\215न मधà¥\215यम वरà¥\215ग
## 4                        Lower class निमà¥\215न वरà¥\215ग
## 5                        Lower class निमà¥\215न वरà¥\215ग
## 6                        Lower class निमà¥\215न वरà¥\215ग
##   SubjectiveSES_2_1
## 1                  
## 2            Rung 2
## 3            Rung 8
## 4            Rung 2
## 5            Rung 1
## 6            Rung 1
##                                                       SubjectiveSES_3_1
## 1                              Somewhat Agree थोड़ा सहमत
## 2                                                    Agree सहमत
## 3                           Strongly Agree बोहोत सहमत
## 4                              Somewhat Agree थोड़ा सहमत
## 5               Strongly Disagree बिलà¥\215कà¥\201ल असहमत
## 6 Neither Agree Nor Disagree ना सहमत ना असहमत
##                                         SubjectiveSES_3_2
## 1                                      Agree सहमत
## 2                                      Agree सहमत
## 3                Somewhat Agree थोड़ा सहमत
## 4                Somewhat Agree थोड़ा सहमत
## 5 Strongly Disagree बिलà¥\215कà¥\201ल असहमत
## 6 Strongly Disagree बिलà¥\215कà¥\201ल असहमत
##                                         SubjectiveSES_3_3
## 1          Somewhat Disagree थोड़ा असहमत
## 2                                      Agree सहमत
## 3                Somewhat Agree थोड़ा सहमत
## 4                                      Agree सहमत
## 5 Strongly Disagree बिलà¥\215कà¥\201ल असहमत
## 6 Strongly Disagree बिलà¥\215कà¥\201ल असहमत
##                                         SubjectiveSES_3_4  location_name
## 1             Strongly Agree बोहोत सहमत Nagar Chaugwan
## 2                                      Agree सहमत Nagar chaugwan
## 3                                Disagree असहमत         Kheria
## 4                                      Agree सहमत Nagar chaugwan
## 5 Strongly Disagree बिलà¥\215कà¥\201ल असहमत          Itoja
## 6 Strongly Disagree बिलà¥\215कà¥\201ल असहमत       Chaugava
##                            culture
## 1                           Family
## 2 Friends , relatives and near me 
## 3                         Relative
## 4                               Na
## 5                              Not
## 6                                 
##                                                                              Culture
## 1 My close friends and family मेरा परिवार और दोसà¥\215त
## 2 My close friends and family मेरा परिवार और दोसà¥\215त
## 3   People who live near me जो मेरे आस पास रहते हà¥\210
## 4   People who live near me जो मेरे आस पास रहते हà¥\210
## 5          People who share my same caste मेरà¥\200 जातà¥\200 के लोग
## 6   People who live near me जो मेरे आस पास रहते हà¥\210
##   Culture_8_TEXT location surveyor_idÂ.  Condition
## 1                  226203       AP-1476 Giving 1st
## 2                  226203       VG-7833  Norms 1st
## 3                  226203       AS_7382 Giving 1st
## 4                  226203     Ts - 3628  Norms 1st
## 5                  226203        SV5372 Giving 1st
## 6                  226203       VP-7257  Norms 1st
##                            country_mismatch
## 1         Mexico (मेकà¥\215सिको)
## 2      South Africa (अफà¥\215रà¥\200का)
## 3 the United States (अमेरिका)
## 4         Mexico (मेकà¥\215सिको)
## 5      South Africa (अफà¥\215रà¥\200का)
## 6         Mexico (मेकà¥\215सिको)
##                     Anika_physicaldist Acountry_match
## 1    Mexico (मेकà¥\215सिको)              0
## 2 South Africa (अफà¥\215रà¥\200का)              0
## 3                 India (भारत)              1
## 4    Mexico (मेकà¥\215सिको)              0
## 5                 India (भारत)              1
## 6                 India (भारत)              1
##                        William_physicaldist Wcountry_match
## 1                      India (भारत)              1
## 2                      India (भारत)              1
## 3 the United States (अमेरिका)              0
## 4                      India (भारत)              1
## 5      South Africa (अफà¥\215रà¥\200का)              0
## 6         Mexico (मेकà¥\215सिको)              0
##                          Anika_religion Areligion_match
## 1     religious (धारà¥\215मिक)               0
## 2 non-religious (नासà¥\215तिक)               0
## 3            Hindu (हिनà¥\215दू)               1
## 4 non-religious (नासà¥\215तिक)               0
## 5            Hindu (हिनà¥\215दू)               1
## 6 non-religious (नासà¥\215तिक)               1
##                        William_religion Wreligion_match
## 1 non-religious (नासà¥\215तिक)               1
## 2            Hindu (हिनà¥\215दू)               1
## 3 non-religious (नासà¥\215तिक)               0
## 4            Hindu (हिनà¥\215दू)               1
## 5 non-religious (नासà¥\215तिक)               0
## 6     religious (धारà¥\215मिक)               0
##                            Anika_family Afamily_match
## 1   large बड़ा परिवार              0
## 2 small छोटा परिवार             1
## 3 small छोटा परिवार             0
## 4 small छोटा परिवार             0
## 5   large बड़ा परिवार              1
## 6   large बड़ा परिवार              1
##                          William_family Wfamily_match
## 1 small छोटा परिवार             1
## 2   large बड़ा परिवार              0
## 3   large बड़ा परिवार              1
## 4   large बड़ा परिवार              1
## 5 small छोटा परिवार             0
## 6 small छोटा परिवार             0
##                                                                                   Anika_hobby
## 1      playing with animals and pets (जानवरों के साथ खेलना)
## 2                                                                 arts and crafts (कला)
## 3  learning new things (नà¤\210 चà¥\200जों के बारे में जानना)
## 4                                                      cooking (खाना बनाना)
## 5 singing and listening to music (गाना या गानों को सà¥\201नना)
## 6                                                      cooking (खाना बनाना)
##   Ahobby_match
## 1            1
## 2            0
## 3            1
## 4            1
## 5            0
## 6            1
##                                                                            William_hobby
## 1                                                            arts and crafts (कला)
## 2                                                 cooking (खाना बनाना)
## 3 playing with animals and pets (जानवरों के साथ खेलना)
## 4                                                            arts and crafts (कला)
## 5                                                 cooking (खाना बनाना)
## 6                                                   playing sports (खेल कूद)
##   Whobby_match
## 1            0
## 2            1
## 3            0
## 4            0
## 5            1
## 6            0
##                                                                       Anika_affliction
## 1 addiction (alcohol or drug) नशा (शराब या धूमà¥\215रपान)
## 2                                                                             HIV/AIDs
## 3 addiction (alcohol or drug) नशा (शराब या धूमà¥\215रपान)
## 4                   malnutrition and hunger (भूकमारà¥\200/कà¥\201पोषण)
## 5 addiction (alcohol or drug) नशा (शराब या धूमà¥\215रपान)
## 6 addiction (alcohol or drug) नशा (शराब या धूमà¥\215रपान)
##   Aaffliction_match
## 1                 1
## 2                 0
## 3                 1
## 4                 0
## 5                 1
## 6                 1
##                                                                     William_affliction
## 1 addiction (alcohol or drug) नशा (शराब या धूमà¥\215रपान)
## 2 addiction (alcohol or drug) नशा (शराब या धूमà¥\215रपान)
## 3 addiction (alcohol or drug) नशा (शराब या धूमà¥\215रपान)
## 4                                             homelessness (बेà¤\230र होना)
## 5 addiction (alcohol or drug) नशा (शराब या धूमà¥\215रपान)
## 6 addiction (alcohol or drug) नशा (शराब या धूमà¥\215रपान)
##   Waffliction_match Anika_y. William_y. Anika_xfold William_xfold
## 1                 0       20         10           2             2
## 2                 1       10         40           5             5
## 3                 0       50         50           3             2
## 4                 1       30         30           4             3
## 5                 0       50         20           2             4
## 6                 0       10         50           2             5
##                                 Anika_caste Acaste William_caste Wcaste
## 1 Shopkeeper दà¥\201कानदारों     UC            NA     NA
## 2            Labourer मजदूरों     LC            NA     NA
## 3 Shopkeeper दà¥\201कानदारों     UC            NA     NA
## 4            Labourer मजदूरों     LC            NA     NA
## 5 Shopkeeper दà¥\201कानदारों     UC            NA     NA
## 6            Labourer मजदूरों     LC            NA     NA

Cleaning

data$Gender_new <- "Other"
data$Gender_new[data$Gender== "Female सà¥\u008dतà¥\u008dरी" ] <- "Female"
data$Gender_new[data$Gender == "Male पà¥\u0081रà¥\u0081ष"] <- "Male"
table(data$Gender_new)
## 
## Female   Male  Other 
##    189    120      2
data$children <- "No"
data$children[data$children.== "Yes (if yes, please list their age and gender(s)) हाà¤\u0081 (कृपया बचà¥\u008dचों की उमà¥\u008dर और लिंग नीचे लिखे):"] <- "Yes" 
table(data$children)
## 
##  No Yes 
##  42 269
data$Residential_Area[data$Residential.Area== "Urban शहर"] <- "Urban"
data$Residential_Area[data$Residential.Area== "Rural गà¥\u008dराम/जिला"] <- "Rural"

table(data$Residential_Area)
## 
## Rural Urban 
##   307     2

Summarising

Demographic

gender <- data %>%
     group_by(Gender_new) %>%
     summarise(counts = n())
gender
## # A tibble: 3 x 2
##   Gender_new counts
##   <chr>       <int>
## 1 Female        189
## 2 Male          120
## 3 Other           2
gender %>% ggplot()+geom_bar(aes(x= Gender_new,y=counts), stat="identity", fill="steelblue4", alpha=0.9)+labs(title = "Gender distribution", 
                 y = "Number of people", 
                 x = "") 

children <- data %>%
     group_by(children) %>%
     summarise(counts = n())

children %>% ggplot()+geom_bar(aes(x= children,y=counts), stat="identity", fill="steelblue4", alpha=0.9)+labs(title = "Do you have any Children?",                                                                 y = "Number of people", 
                          x = "") 

Personal Decisions

Personal_C <- data %>%  
  select(Char_Community_2, Char_Caste._2,  Char_Country_2 ,Char_Ideology_2, 
         Char_Religion_2, Char_Generation_2, Char_Species_2, Char_CausePriority_2,
         Char_CausePassion_2)

summary(Personal_C)
##  Char_Community_2 Char_Caste._2    Char_Country_2  Char_Ideology_2 
##  Min.   :  0.00   Min.   :  0.00   Min.   :  0.0   Min.   :  0.00  
##  1st Qu.: 50.00   1st Qu.: 30.00   1st Qu.: 10.0   1st Qu.: 50.00  
##  Median : 50.00   Median : 50.00   Median : 50.0   Median : 50.00  
##  Mean   : 52.51   Mean   : 46.08   Mean   : 41.3   Mean   : 53.98  
##  3rd Qu.: 70.00   3rd Qu.: 60.00   3rd Qu.: 50.0   3rd Qu.: 70.00  
##  Max.   :100.00   Max.   :100.00   Max.   :100.0   Max.   :100.00  
##  Char_Religion_2  Char_Generation_2 Char_Species_2   Char_CausePriority_2
##  Min.   :  0.00   Min.   :  0.00    Min.   :  0.00   Min.   :  0.00      
##  1st Qu.: 20.00   1st Qu.: 30.00    1st Qu.: 50.00   1st Qu.: 50.00      
##  Median : 50.00   Median : 50.00    Median : 50.00   Median : 50.00      
##  Mean   : 43.59   Mean   : 44.94    Mean   : 57.56   Mean   : 50.95      
##  3rd Qu.: 60.00   3rd Qu.: 50.00    3rd Qu.: 80.00   3rd Qu.: 60.00      
##  Max.   :100.00   Max.   :100.00    Max.   :100.00   Max.   :100.00      
##  Char_CausePassion_2
##  Min.   :  0.00     
##  1st Qu.: 30.00     
##  Median : 50.00     
##  Mean   : 46.11     
##  3rd Qu.: 50.00     
##  Max.   :100.00

Norms Decisions

Norm_C <- data %>% 
  select( Norm_Community_2, Norm_Caste_2,  Norm_Country_2 ,Norm_Ideology_2, 
          Norm_Religion_2, Norm_Generation_2, Norm_Species_2, Norm_CausPriority_2,
          Norm_CausePassion_2)
summary(Norm_C)
##  Norm_Community_2  Norm_Caste_2    Norm_Country_2   Norm_Ideology_2
##  Min.   :  0.00   Min.   :  0.00   Min.   :  0.00   Min.   :  0.0  
##  1st Qu.: 40.00   1st Qu.: 35.00   1st Qu.: 10.00   1st Qu.: 50.0  
##  Median : 50.00   Median : 50.00   Median : 50.00   Median : 50.0  
##  Mean   : 50.95   Mean   : 48.07   Mean   : 40.47   Mean   : 54.1  
##  3rd Qu.: 60.00   3rd Qu.: 60.00   3rd Qu.: 50.00   3rd Qu.: 60.0  
##  Max.   :100.00   Max.   :100.00   Max.   :100.00   Max.   :100.0  
##  Norm_Religion_2  Norm_Generation_2 Norm_Species_2   Norm_CausPriority_2
##  Min.   :  0.00   Min.   :  0.00    Min.   :  0.00   Min.   :  0.00     
##  1st Qu.: 20.00   1st Qu.: 20.00    1st Qu.: 50.00   1st Qu.: 50.00     
##  Median : 50.00   Median : 50.00    Median : 50.00   Median : 50.00     
##  Mean   : 43.18   Mean   : 44.04    Mean   : 55.82   Mean   : 51.37     
##  3rd Qu.: 50.00   3rd Qu.: 50.00    3rd Qu.: 70.00   3rd Qu.: 60.00     
##  Max.   :100.00   Max.   :100.00    Max.   :100.00   Max.   :100.00     
##  Norm_CausePassion_2
##  Min.   :  0.00     
##  1st Qu.: 22.50     
##  Median : 50.00     
##  Mean   : 44.21     
##  3rd Qu.: 50.00     
##  Max.   :100.00

Graphing EA decisions

Personal Decisions

Norms Decisions

Average giving

Amount_given <- data.frame(
     name= c("Personal Donation", "Norms Donation"),
     mean= c(mean(data$Char_Generosity, na.rm=TRUE),mean(data$N_Generosity2, na.rm=TRUE)),
     sd=c(sd(data$Char_Generosity, na.rm=TRUE), sd(data$N_Generosity2, na.rm=TRUE) ))
 
Amount_given %>% 
     mutate(Percentage_Given = mean/50) %>%
     mutate(se = sd/sqrt(311)) %>% 
     mutate(me =qt(0.975,df=311-1)*se)  -> Amount_given

 Amount_given %>% 
     ggplot() + geom_bar(aes(x = name, y = Percentage_Given), stat = "identity", fill = "steelblue4", alpha=0.9, width = 0.5) + ylim(0, 100) +
     geom_errorbar( aes(x=name, ymin=Percentage_Given-me, ymax=Percentage_Given+me), width=0.4, colour="black", alpha=0.9, size=0.4) +
     labs(title = "Generosity Measure", 
                   subtitle = "What percentage of the INR 5000 amount do people give?",
                   y= "Average Amount in Percentage", 
                   x="") +
     geom_text(aes(label = Percentage_Given, x = name, y = Percentage_Given), vjust = -0.8) +
     theme_hc() +
     theme(axis.title = element_text())

T-tests

Community_t <- t.test(data$Char_Community_2,data$Norm_Community_2, paired = TRUE)
Caste_t <-t.test(data$Char_Caste._2, data$Norm_Caste_2, paired = TRUE)
Country_t <-t.test(data$Char_Country_2, data$Norm_Country_2, paired = TRUE)
Ideology_t <- t.test(data$Char_Ideology_2, data$Norm_Ideology_2, paired= TRUE)
Religion_t <-t.test(data$Char_Religion_2, data$Norm_Religion_2, paired = TRUE)
Generation_t <-t.test(data$Char_Generation_2, data$Norm_Generation_2, paired = TRUE)
Species_t <-t.test(data$Char_Species_2, data$Norm_Species_2, paired = TRUE)
Cause_Priority_t <-t.test(data$Char_CausePriority_2, data$Norm_CausPriority_2, paired = TRUE)
Cause_Passion_t <-t.test(data$Char_CausePassion_2, data$Norm_CausePassion_2, paired = TRUE)
 
tab_ttests <- map_df(list(Community_t, Caste_t,Country_t, Religion_t, Ideology_t, Generation_t, Species_t, Cause_Priority_t, Cause_Passion_t), tidy)
tab_ttests[c("estimate", "statistic", "p.value")]
## # A tibble: 9 x 3
##   estimate statistic p.value
##      <dbl>     <dbl>   <dbl>
## 1    1.56     1.09     0.276
## 2   -1.99    -1.59     0.114
## 3    0.836    0.633    0.527
## 4    0.402    0.349    0.727
## 5   -0.119   -0.0942   0.925
## 6    0.900    0.768    0.443
## 7    1.74     1.48     0.141
## 8   -0.421   -0.382    0.702
## 9    1.90     1.45     0.148
tab_ttests
## # A tibble: 9 x 8
##   estimate statistic p.value parameter conf.low conf.high method     alternative
##      <dbl>     <dbl>   <dbl>     <dbl>    <dbl>     <dbl> <chr>      <chr>      
## 1    1.56     1.09     0.276       310   -1.25      4.37  Paired t-~ two.sided  
## 2   -1.99    -1.59     0.114       310   -4.47      0.478 Paired t-~ two.sided  
## 3    0.836    0.633    0.527       310   -1.76      3.44  Paired t-~ two.sided  
## 4    0.402    0.349    0.727       310   -1.86      2.67  Paired t-~ two.sided  
## 5   -0.119   -0.0942   0.925       310   -2.61      2.37  Paired t-~ two.sided  
## 6    0.900    0.768    0.443       310   -1.41      3.21  Paired t-~ two.sided  
## 7    1.74     1.48     0.141       310   -0.579     4.05  Paired t-~ two.sided  
## 8   -0.421   -0.382    0.702       310   -2.59      1.75  Paired t-~ two.sided  
## 9    1.90     1.45     0.148       310   -0.680     4.47  Paired t-~ two.sided