Number of Seats Campaigned by Modi and Rahul in 2019 and
2024
Modi |
135 |
185 |
Rahul |
106 |
73 |
Merge the two datasets for yearly comparision
## [1] "Rahul Gandhi held rallies in 61 constituencies where an INC member was contesting and 12 where an ally was contesting"
## [1] "Modi held rallies in 167 constituencies where a BJP member was contesting and 16 where an ally was contesting"
## [1] "Rahul Gandhi campaigned in 5 constiteuncies for allies and in 91 for INC candidates in 2019"
## [1] "Modi campaigned in 8 constiteuncies for allies and in 125 for INC candidates in 2019"
Statewise Distribution of Seats Neither Visited in 2019 and 2024
|
State
|
Number of Seats
|
Andaman_&_Nicobar_Islands
|
1
|
Andhra_Pradesh
|
17
|
Assam
|
7
|
Bihar
|
18
|
Chhattisgarh
|
2
|
Dadra_&_Nagar_Haveli
|
1
|
Delhi
|
5
|
Gujarat
|
15
|
Haryana
|
2
|
Himachal_Pradesh
|
1
|
Jammu_&_Kashmir
|
4
|
Jharkhand
|
3
|
Karnataka
|
10
|
Kerala
|
9
|
Lakshadweep
|
1
|
Madhya_Pradesh
|
6
|
Maharashtra
|
22
|
Manipur
|
1
|
Meghalaya
|
2
|
Mizoram
|
1
|
Nagaland
|
1
|
Odisha
|
4
|
Puducherry
|
1
|
Punjab
|
4
|
Rajasthan
|
7
|
Sikkim
|
1
|
Tamil_Nadu
|
28
|
Telangana
|
5
|
Uttar_Pradesh
|
28
|
West_Bengal
|
14
|
Statewise Distribution of Seats Both Visited in 2019 and 2024
State
|
Number_of_Seats
|
Andhra_Pradesh
|
2
|
Assam
|
1
|
Bihar
|
8
|
Chandigarh
|
1
|
Chhattisgarh
|
1
|
Delhi
|
1
|
Gujarat
|
2
|
Haryana
|
2
|
Himachal_Pradesh
|
3
|
Jammu_&_Kashmir
|
1
|
Jharkhand
|
3
|
Karnataka
|
6
|
Kerala
|
5
|
Madhya_Pradesh
|
8
|
Maharashtra
|
9
|
Odisha
|
4
|
Punjab
|
3
|
Rajasthan
|
9
|
Tamil_Nadu
|
2
|
Telangana
|
3
|
Uttar_Pradesh
|
20
|
Uttarakhand
|
2
|
West_Bengal
|
9
|
Combined Rally Data for Modi and Rahul by Year and Constituency Type
|
2019
|
2024
|
Person
|
For_Whom
|
GEN (411)(75.5%)
|
SC (84)(15.5%)
|
ST (48)(9%)
|
GEN (411)(75.5%)
|
SC (84)(15.5%)
|
ST (48)(9%)
|
Modi
|
Modi
|
Ally
|
8
|
1
|
0
|
12
|
4
|
0
|
|
Self
|
94
|
17
|
13
|
122
|
24
|
17
|
Rahul
|
Rahul
|
Ally
|
5
|
0
|
0
|
10
|
0
|
1
|
|
Self
|
65
|
20
|
6
|
42
|
11
|
8
|
Hard task of MoU
#For2009
data2009 <- read.csv("~/Desktop/Congress Paper/data2009.csv")
data2009 <- data2009 %>%
mutate(Constituency_Name = case_when(
Constituency_Name == 'GOPALGANJ' ~ 'GOPALGANJ (SC)',
TRUE ~ Constituency_Name
))
data2009 <- data2009 %>%
mutate(Constituency_Name = case_when(
Constituency_Name == 'HAJIPUR' ~ 'HAJIPUR (SC)',
TRUE ~ Constituency_Name
))
data2009 <- data2009 %>%
mutate(Constituency_Name = case_when(
Constituency_Name == 'SAMASTIPUR' ~ 'SAMASTIPUR (SC)',
TRUE ~ Constituency_Name
))
data2009 <- data2009 %>%
mutate(Constituency_Name = case_when(
Constituency_Name == 'GAYA' ~ 'GAYA (SC)',
TRUE ~ Constituency_Name
))
data2009 <- data2009 %>%
mutate(Constituency_Name = case_when(
Constituency_Name == 'JAMUI' ~ 'JAMUI (SC)',
TRUE ~ Constituency_Name
))
data2009 <- data2009 %>%
mutate(Constituency_Name = case_when(
Constituency_Name == 'SASARAM' ~ 'SASARAM (SC)',
TRUE ~ Constituency_Name
))
data2009 <- data2009 %>%
mutate(Constituency_Name = case_when(
Constituency_Name == 'FEROZPUR' ~ 'FIROZPUR',
TRUE ~ Constituency_Name
))
data2009 <- data2009 %>%
mutate(Constituency_Name = case_when(
Constituency_Name == 'NORTH WEST DELHI' ~ 'NORTH WEST DELHI',
TRUE ~ Constituency_Name
))
data2009 <- data2009 %>%
mutate(Constituency_Name = case_when(
Constituency_Name == 'WEST DELHI' ~ 'WEST DELHI',
TRUE ~ Constituency_Name
))
data2009 <- data2009 %>%
mutate(Constituency_Name = case_when(
Constituency_Name == 'GAUTAM BUDDH NAGAR' ~ 'GAUTAM BUDDHA NAGAR',
TRUE ~ Constituency_Name
))
data2009 <- data2009 %>%
group_by(Constituency_Name) %>%
mutate(
BJPMoU2009 = if ("BJP" %in% Party) {
# BJP's vote share
bjp_vote_share <- Vote_Share_Percentage[Party == "BJP"]
# Winner's vote share
winner_vote_share <- Vote_Share_Percentage[Position == 1]
# If BJP is the winner, compare with the second-highest vote share
if (Position[Party == "BJP"] == 1) {
second_highest_vote_share <- Vote_Share_Percentage[Position == 2]
bjp_vote_share - second_highest_vote_share
} else {
# If BJP is not the winner, compare with the winner
bjp_vote_share - winner_vote_share
}
} else {
# If BJP is not present in the constituency, set NA
NA_real_
}
) %>%
ungroup()
#For INC
data2009 <- data2009 %>%
group_by(Constituency_Name) %>%
mutate(
INCMoU2009 = if ("INC" %in% Party) {
inc_vote_share <- Vote_Share_Percentage[Party == "INC"]
winner_vote_share <- Vote_Share_Percentage[Position == 1]
if (Position[Party == "INC"] == 1) {
second_highest_vote_share <- Vote_Share_Percentage[Position == 2]
inc_vote_share - second_highest_vote_share
} else {
inc_vote_share - winner_vote_share
}
} else {
NA_real_
}
) %>%
ungroup()
# For 2014 now
data2014 <- read.csv("~/Desktop/Congress Paper/data2014.csv")
data2014 <- data2014 %>%
group_by(Constituency_Name) %>%
mutate(
BJPMoU2014 = if ("BJP" %in% Party) {
# BJP's vote share
bjp_vote_share <- Vote_Share_Percentage[Party == "BJP"]
# Winner's vote share
winner_vote_share <- Vote_Share_Percentage[Position == 1]
# If BJP is the winner, compare with the second-highest vote share
if (Position[Party == "BJP"] == 1) {
second_highest_vote_share <- Vote_Share_Percentage[Position == 2]
bjp_vote_share - second_highest_vote_share
} else {
# If BJP is not the winner, compare with the winner
bjp_vote_share - winner_vote_share
}
} else {
# If BJP is not present in the constituency, set NA
NA_real_
}
) %>%
ungroup()
#For INC
data2014 <- data2014 %>%
group_by(Constituency_Name) %>%
mutate(
INCMoU2014 = if ("INC" %in% Party) {
inc_vote_share <- Vote_Share_Percentage[Party == "INC"]
winner_vote_share <- Vote_Share_Percentage[Position == 1]
if (Position[Party == "INC"] == 1) {
second_highest_vote_share <- Vote_Share_Percentage[Position == 2]
inc_vote_share - second_highest_vote_share
} else {
inc_vote_share - winner_vote_share
}
} else {
NA_real_
}
) %>%
ungroup()
# For 2019
data2019 <- read.csv("~/Desktop/Congress Paper/data2019.csv")
data2019 <- data2019 %>%
filter(!(Constituency_Name == 'SATARA' & month == 4))
data2019 <- data2019 %>%
filter(!(Constituency_Name == 'SAMASTIPUR' & month == 4))
data2019 <- data2019 %>%
mutate(Constituency_Name = case_when(
Constituency_Name == 'CHEVELLA' ~ 'CHELVELLA',
TRUE ~ Constituency_Name
))
data2019 <- data2019 %>%
mutate(Constituency_Name = case_when(
Constituency_Name == 'JAYNAGAR' ~ 'JOYNAGAR',
TRUE ~ Constituency_Name
))
data2019 <- data2019 %>%
mutate(Constituency_Name = case_when(
Constituency_Name == 'BARDHAMAN DURGAPUR' ~ 'BURDWAN - DURGAPUR',
TRUE ~ Constituency_Name
))
data2019 <- data2019 %>%
mutate(Constituency_Name = case_when(
Constituency_Name == 'BIKANER (SC)' ~ 'BIKANER',
TRUE ~ Constituency_Name
))
data2019 <- data2019 %>%
mutate(Constituency_Name = case_when(
Constituency_Name == 'DADRA AND NAGAR HAVELI' ~ 'DADAR & NAGAR HAVELI',
TRUE ~ Constituency_Name
))
data2019 <- data2019 %>%
group_by(Constituency_Name) %>%
mutate(
BJPMoU2019 = if ("BJP" %in% Party) {
# BJP's vote share
bjp_vote_share <- Vote_Share_Percentage[Party == "BJP"]
# Winner's vote share
winner_vote_share <- Vote_Share_Percentage[Position == 1]
# If BJP is the winner, compare with the second-highest vote share
if (Position[Party == "BJP"] == 1) {
second_highest_vote_share <- Vote_Share_Percentage[Position == 2]
bjp_vote_share - second_highest_vote_share
} else {
# If BJP is not the winner, compare with the winner
bjp_vote_share - winner_vote_share
}
} else {
# If BJP is not present in the constituency, set NA
NA_real_
}
) %>%
ungroup()
#For INC
data2019 <- data2019 %>%
group_by(Constituency_Name) %>%
mutate(
INCMoU2019 = if ("INC" %in% Party) {
inc_vote_share <- Vote_Share_Percentage[Party == "INC"]
winner_vote_share <- Vote_Share_Percentage[Position == 1]
if (Position[Party == "INC"] == 1) {
second_highest_vote_share <- Vote_Share_Percentage[Position == 2]
inc_vote_share - second_highest_vote_share
} else {
inc_vote_share - winner_vote_share
}
} else {
NA_real_
}
) %>%
ungroup()
# Let us now merge it to the merged1924
data2009winners <- data2009 %>% filter(Position == 1)
data2014winners <- data2014 %>% filter(Position == 1)
data2019winners <- data2019 %>% filter(Position == 1)
constituencies_2009 <- unique(data2009winners$Constituency_Name)
constituencies_2014 <- unique(data2014winners$Constituency_Name)
constituencies_2019 <- unique(data2019winners$Constituency_Name)
# Combine all unique constituency names
all_constituencies <- union(union(constituencies_2009, constituencies_2014), constituencies_2019)
# Create a summary table
missing_summary <- data.frame(
Constituency_Name = all_constituencies,
In_2009 = all_constituencies %in% constituencies_2009,
In_2014 = all_constituencies %in% constituencies_2014,
In_2019 = all_constituencies %in% constituencies_2019
)
missing_summary <- missing_summary %>%
filter(!(In_2009 & In_2014 & In_2019))
merged1924 <- read.csv("~/Desktop/Congress Paper/merged1924.csv", sep=";")
merged1924 <- merged1924 %>%
left_join(select(data2019winners, Constituency_Name, BJPMoU2019, INCMoU2019), by = "Constituency_Name") %>%
left_join(select(data2014winners, Constituency_Name, BJPMoU2014, INCMoU2014), by = "Constituency_Name") %>%
left_join(select(data2009winners, Constituency_Name, BJPMoU2009, INCMoU2009), by = "Constituency_Name")