##Introduction and Background: Data Action Lab for Emerging Societies undertook a nationwide survey of 36,000 registered voters across 20 states via face-to-face interactions. This comprehensive effort aims to create a detailed portrait of the Indian electorate, exploring diverse areas such as electoral preferences, access to welfare, and political leadership. Specifically, the survey includes sections on electoral preferences, access to welfare schemes/benefits, political leadership, perceptions of voters, citizenship, media usage and tailored questions for the states. It aims to probe deep into themes of nationalism, secularism, federalism, and the impact of misinformation, all contextualized through the voters’ social positions.

##Methodology & Sampling Design: Samples were drawn from 200 randomly chosen parliamentary constituencies (PCs) across 20 key states in India. This entails 1,600 polling booths and a total sample size of 38,400 respondents. The selected states account for 513 out of the 543 parliamentary constituencies in the country. Among the 200 PCs, 33 were reserved for Scheduled Castes (SCs) and 16 for Scheduled Tribes (STs).

A systematic random sampling with replacement technique was used to choose 4 assembly constituencies (ACs) from each PC ,i.e., 800 ACs across the country. In each AC, 2 polling booths (PBs) were selected at random, and 24 respondents were randomly chosen from each booth. For the smooth of the survey, a face page was provided to enumerators, containing details about the parliamentary constituency, assembly constituency, polling booth, and the selected and replacement respondents from each booth (with 3 replacements for each respondent). This ensured that the designated sampling design was strictly followed and selection bias was avoided. The use of electoral rolls for each PB was necessary to reduce post-estimation errors and maintain accurate tracking of respondents.

A dictionary of state-level and national welfare schemes was created to account for differences in welfare delivery across various Indian states. The field teams were also encouraged to provide feedback and suggest questions specific to the state’s political landscape. The final questionnaire was translated into selected regional languages, and was later scripted on a survey platform.

##Theme and Significance Stars

##Reading Files and Wrangling data

ies_study <- read_excel("/Users/gurkirat/Desktop/Political Behaviour Survey/DALES Survey Responses June 18.xlsx")
codebook_iesmain <- read_excel("/Users/gurkirat/Desktop/Political Behaviour Survey/Codebook_DALES .xlsx", sheet = 1)
alliances <- read_excel("/Users/gurkirat/Desktop/Political Behaviour Survey/List of alliance arrangements.xlsx")

##Cleaning Media Perceptions
ies_study <- ies_study %>% 
  mutate(mu3 = ifelse(mu3 == "Facebook", "Facebook",
        ifelse(mu3 == "Instagram", "Instagram", 
        ifelse(mu3 == "Newspapers", "Newspapers",
        ifelse(mu3 == "Television Channels/TV", "Television Channels/TV",
        ifelse(mu3 == "Twitter", "Twitter",
        ifelse(mu3 == "WhatsApp", "WhatsApp",
        ifelse(mu3 == "Youtube", "Youtube", "Others"))))))))

#Reconstructing Asset Categories
asset_list <- c("Air Conditioner", "Air Cooler", "Bicycle",
                "Car/Four-wheeler/Six or Eight wheeler for commercial use",
                "Car/Four wheeler for private use", "Electric Fan", "Laptop/Computer", 
                "Motorized Two wheeler", "None of the above", "Television",  "Tractor", "Truck",
                "Washing Machine", "Water purifier")

ies_study <- ies_study %>%
  mutate(
    Television = ifelse(str_detect(dh20, "Television"), 1, 0),
    Electric_Fan = ifelse(str_detect(dh20, "Electric Fan"), 1, 0),
    Air_Cooler = ifelse(str_detect(dh20, "Air Cooler"), 1, 0),
    Air_Conditioner = ifelse(str_detect(dh20, "Air Conditioner"), 1, 0),
    Water_purifier = ifelse(str_detect(dh20, "Water purifier"), 1, 0),
    Bicycle = ifelse(str_detect(dh20, "Bicycle"), 1, 0),
    Motorized_Two_wheeler = ifelse(str_detect(dh20, "Motorized Two wheeler"), 1, 0),
    Washing_Machine = ifelse(str_detect(dh20, "Washing Machine"), 1, 0),
    Laptop_Computer = ifelse(str_detect(dh20, "Laptop/Computer"), 1, 0),
    Car_Private = ifelse(str_detect(dh20, "Car/Four wheeler for private use"), 1, 0),
    Car_Commercial = ifelse(str_detect(dh20, "Car/Four-wheeler/Six or Eight wheeler for commercial use"), 1, 0),
    Tractor = ifelse(str_detect(dh20, "Tractor"), 1, 0),
    Truck = ifelse(str_detect(dh20, "Truck"), 1, 0),
    None_of_the_above = ifelse(str_detect(dh20, "None of the above"), 1, 0)
  )

ies_study$asset_count <- rowSums(ies_study[,c(150:162)])

ies_study <- ies_study %>% 
  mutate(revised_assetcat = ifelse(asset_count >= 0 & asset_count <= 2, 1,
                            ifelse(asset_count >= 3 & asset_count <= 4, 2,
                            ifelse(asset_count >= 5 & asset_count <= 7, 3, 4))))

##Reconstruction Religion
ies_study <- ies_study %>% 
  mutate(revised_religion = ifelse(dh14 == "Hindu", "Hinduism",
                         ifelse(dh14 == "Muslim", "Islam", 
                         ifelse(dh14 == "Did not mention", "Refused to Mention", "Other Minorities"))))

##Categorizing Education
ies_study <- ies_study %>% 
  mutate(revised_education = ifelse(dh1 == "Not literate", 0,
                             ifelse(dh1 == "Below Primary", 1,
                             ifelse(dh1 == "Primary", 2,
                             ifelse(dh1 == "Middle School (Class-VIII)", 3,
                             ifelse(dh1 == "Secondary", 4,
                             ifelse(dh1 == "Higher Secondary", 5,
                             ifelse(dh1 == "Technical Diploma (after Secondary/Higher Secondary)-ITI etc", 6,
                             ifelse(dh1 == "Graduate" | dh1 == "Professional Degree", 7, 8)))))))))

##Caste and Religion common category
ies_study <- ies_study %>% 
  mutate(caste_rel = ifelse(revised_religion == "Hinduism" & dh5 == "General", "Hindu and UC",
                     ifelse(revised_religion == "Hinduism" & dh5 == "Other Backward Class (OBC)", "Hindu and OBC",
                     ifelse(revised_religion == "Hinduism" & dh5 == "Scheduled Caste (SC)/Dalit", "Hindu and SC",
                     ifelse(revised_religion == "Hinduism" & dh5 == "Scheduled Tribe (ST)/Adivasi", "Hindu and ST",
                     ifelse(revised_religion == "Islam", "Muslim", "Others/Refused to Mention"))))))

##Congress vs Non-Congress States
ies_study <- ies_study %>% 
  mutate(marg_prom = ifelse(bi1 == "Andhra Pradesh" | bi1 == "Bihar" | bi1 == "Delhi" | bi1 == "Jharkhand" | bi1 == "Odisha" | bi1 == "Tamil Nadu" | bi1 == "Uttar Pradesh" | bi1 == "West Bengal", "Marginal", "Prominent"))

##Constructing Alliance Categories

al_party <- alliances %>% 
  dplyr::select(`Party Name`, `Revised Alliance Categories`, `Adjustments Made (Yes/No)`) %>% 
  filter(`Adjustments Made (Yes/No)` == "No")

ies_study_ls24_dta <- merge(ies_study, al_party, by.x = "ep2", by.y = "Party Name") %>% 
  rename("Alliance" = `Revised Alliance Categories`)

###Voter Category I
ies_study_ls24_dta <- ies_study_ls24_dta  %>% 
  mutate (voter_cat1 = ifelse(ep2 == "Indian National Congress", "Voted for the Congress",
              ifelse(ep2 != "Indian National Congress" & Alliance == "INDIA", "Voted for INDIA but not Congress",
              ifelse(ep2 == "Bharatiya Janata Party", "Voted for the BJP",
              ifelse(ep2 != "Bharatiya Janata Party" & Alliance == "NDA", "Voted for the NDA but not BJP",
              ifelse(ep2 == "Independent Candidate" | ep2 == "Others" | ep2 == "NOTA", "Voted for Independent Candidate/Others/NOTA",
              ifelse(ep2 == "Don't want to specify", "Don't want to specify", "Voted for the Third Front")))))))

ies_study_ls24_dta <- ies_study_ls24_dta  %>% 
  mutate (voter_cat2 = ifelse(voter_cat1 == "Voted for the Congress" & pl20 == "Yes", "Voted for the Congress and likes RG",
          ifelse(voter_cat1 == "Voted for the Congress" & pl20 == "No", "Voted for the Congress and does not like RG",
          ifelse(voter_cat1 == "Voted for INDIA but not Congress" & pl20 == "Yes", "Voted for INDIA and like RG",
          ifelse(voter_cat1 == "Voted for INDIA but not Congress" & pl20 == "No", "Voted for INDIA and does not like RG",
          ifelse(voter_cat1 == "Voted for the BJP" & pl20 == "Yes", "Voted for the BJP and like RG",
          ifelse(voter_cat1 == "Voted for the BJP" & pl20 == "No", "Voted for the BJP and does not like RG",
          ifelse(voter_cat1 == "Voted for the NDA but not BJP" & pl20 == "Yes", "Voted for the NDA and like RG",
          ifelse(voter_cat1 == "Voted for the NDA but not BJP" & pl20 == "No", "Voted for the NDA and does not like RG",
          ifelse( pl20 == "Yes" & 
          (voter_cat1 == "Voted for the Third Front" | voter_cat1 == "Voted for Independent Candidate/Others/NOTA" | voter_cat1 ==  "Don't want to specify"),
          "Voted for the Third Front/Others/didn't specify and like RG", "Voted for the Third Front/Others/didn't specify and does not like RG"))))))))))

##Descriptive Analysis of Vote Share and Preferences for RG

ies_study_ls24_dta$voter_cat1 <- factor(ies_study_ls24_dta$voter_cat1, 
                               levels = c("Voted for the Congress", "Voted for INDIA but not Congress", "Voted for the BJP", 
                                          "Voted for the NDA but not BJP", "Voted for the Third Front", "Voted for Independent Candidate/Others/NOTA"
                                          , "Don't want to specify"))

prop_variables <- c("pl20", "pl33", "pl34", "pl35", "pl36", "pov1", "pov2", "pov3", "pov4", "pov5", "pov6", "pov7", "pov8", "c1", "c5", "c6", "c7", "c8", "c10", "c11", "c12", "mu3")

var_labels <- c("Is Rahul Gandhi a good leader?", "Biggest achievement of BJP government?", "Biggest failure of BJP government?",
"Which system do you prefer?", "Is it okay for a party to give tickets to defectors?", "Do women in your household decide their vote?",
"Should women have reservations in Parliament?", "Should women have reservations in jobs?", "Should scheme money be in women’s accounts?",
"Should there be a caste census?", "Is the EVM electoral process fair?", "Why do you think the constitution is important?",
"Should CM and PM be from the same party?", "Has inequality risen in India?", "Is it a right to demand welfare?",
"How should the government view citizens?", "What is India’s religious character?", "Should temples replace mosques in Mathura, Kashi?",
"Have Hindus been discriminated against historically?", "Will BJP change the constitution if re-elected?",
"Does Congress play appeasement politics?", "What is the most important news source?")

a <- codebook_iesmain %>% 
  dplyr::select(`Variable Label (English)`, `Variable Name`) %>% 
  filter(`Variable Name`%in% prop_variables)

# Create an empty list to store plots
plot_list <- list()

# Loop over each variable in prop_variables
for (i in seq_along(prop_variables)) {
  
  var <- prop_variables[i]  # Get the current variable
  var_label <- var_labels[i]  # Get the corresponding label
  
  # Compute proportions for the specific variable
  proportion_data <- ies_study_ls24_dta %>%
    group_by(voter_cat1, !!sym(var)) %>%  # Group by voter_cat1 and the current variable
    summarise(count = n()) %>%
    mutate(proportion = count / sum(count)) %>%
    ungroup()
  
  # Generate the plot for the current variable
  p <- ggplot(proportion_data, aes(x = voter_cat1, y = proportion, fill = !!sym(var))) +
    geom_bar(stat = "identity", position = "fill") +  # Stacked bars with proportions summing to 1
    geom_text(aes(label = scales::percent(proportion, accuracy = 0.1)), 
              position = position_stack(vjust = 0.5),  # Center the labels inside the bars
              size = 3, color = "white") +
    labs(subtitle = paste("Proportion Chart:", var_label), 
         x = "Voter Category", 
         y = "Proportion", 
         fill = var) +
    newtheme +  # Assuming `newtheme` is a predefined theme you're using
    scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) +  # Wrap x-axis labels
    theme(legend.position = "right") +  # Keep the legend on the right
    scale_fill_discrete(labels = function(x) str_wrap(x, width = 20))
  
  # Store the plot in the list
  plot_list[[var]] <- p
}

for (var in names(plot_list)) {
  print(plot_list[[var]])
}

##Descriptive Analysis of Vote Share, Preferences for RG and selected survey questions

ies_study_ls24_dta$voter_cat2 <- as.factor(ies_study_ls24_dta$voter_cat2)

ies_study_ls24_dta$voter_cat2 <- factor(ies_study_ls24_dta$voter_cat2, 
  levels = c("Voted for the Congress and likes RG", "Voted for the Congress and does not like RG",
           "Voted for INDIA and like RG", "Voted for INDIA and does not like RG",
           "Voted for the BJP and like RG",  "Voted for the BJP and does not like RG",
           "Voted for the NDA and like RG",  "Voted for the NDA and does not like RG",
           "Voted for the Third Front/Others/didn't specify and like RG",  "Voted for the Third Front/Others/didn't specify and does not like RG"))


prop_variables <- c("pl33", "pl34", "pl35", "pl36", "pov1", "pov2", "pov3", "pov4", "pov5", "pov6", "pov7", "pov8", "c1", "c5", "c6", "c7", "c8", "c10", "c11", "c12", "mu3")

var_labels <- c("Biggest achievement of BJP government?", "Biggest failure of BJP government?",
"Which system do you prefer?", "Is it okay for a party to give tickets to defectors?", "Do women in your household decide their vote?",
"Should women have reservations in Parliament?", "Should women have reservations in jobs?", "Should scheme money be in women’s accounts?",
"Should there be a caste census?", "Is the EVM electoral process fair?", "Why do you think the constitution is important?",
"Should CM and PM be from the same party?", "Has inequality risen in India?", "Is it a right to demand welfare?",
"How should the government view citizens?", "What is India’s religious character?", "Should temples replace mosques in Mathura, Kashi?",
"Have Hindus been discriminated against historically?", "Will BJP change the constitution if re-elected?",
"Does Congress play appeasement politics?", "What is the most important news source?")

a <- codebook_iesmain %>% 
  dplyr::select(`Variable Label (English)`, `Variable Name`) %>% 
  filter(`Variable Name`%in% prop_variables)

# Create an empty list to store plots
plot_list <- list()

# Loop over each variable in prop_variables
for (i in seq_along(prop_variables)) {
  
  var <- prop_variables[i]  # Get the current variable
  var_label <- var_labels[i]  # Get the corresponding label
  
  # Compute proportions for the specific variable
  proportion_data <- ies_study_ls24_dta %>%
    group_by(voter_cat2, !!sym(var)) %>%  # Group by voter_cat2 and the current variable
    summarise(count = n()) %>%
    mutate(proportion = count / sum(count)) %>%
    ungroup()
  
  # Generate the plot for the current variable
  p <- ggplot(proportion_data, aes(x = voter_cat2, y = proportion, fill = !!sym(var))) +
    geom_bar(stat = "identity", position = "fill") +  # Stacked bars with proportions summing to 1
    geom_text(aes(label = scales::percent(proportion, accuracy = 0.1)), 
              position = position_stack(vjust = 0.5),  # Center the labels inside the bars
              size = 3, color = "white") +
    labs(subtitle = paste("Proportion Chart:", var_label), 
         x = "Voter Category", 
         y = "Proportion", 
         fill = var) +
    newtheme +  # Assuming `newtheme` is a predefined theme you're using
    scale_x_discrete(labels = function(x) str_wrap(x, width = 10)) +  # Wrap x-axis labels
    theme(legend.position = "right") +  # Keep the legend on the right
    scale_fill_discrete(labels = function(x) str_wrap(x, width = 20))
  
  # Store the plot in the list
  plot_list[[var]] <- p
}

for (var in names(plot_list)) {
  print(plot_list[[var]])
}

##Model1: Modelling preferences for RG among all voters ###Defining dependent and independent variables

###Definining Predictors & Outcome Variables
all_voters <- ies_study_ls24_dta %>% 
  filter(bi15 < 100)

y0 <- ifelse(all_voters$pl20 == "Yes", 1, 0)

##Predictors
#Demography
all_voters$bi1 <- as.factor(all_voters$bi1)
all_voters$bi1 <- relevel(all_voters$bi1, ref = "Gujarat")
s_ <- all_voters$bi1

level_of_education <- all_voters$revised_education

age <- all_voters$bi15

male <- ifelse(all_voters$bi13 == "Male", 1, 0)
female <- ifelse(all_voters$bi13 == "Female", 1, 0)

rural <- ifelse(all_voters$bi11 == "Rural", 1, 0)
urban <- ifelse(all_voters$bi11 == "Urban", 1, 0)

all_voters$caste_rel <- as.factor(all_voters$caste_rel)
all_voters$caste_rel <- relevel(all_voters$caste_rel, ref = "Others/Refused to Mention")
caste_religion <- all_voters$caste_rel

farmers <- ifelse(all_voters$dh3 == "Farmer", 1, 0)
casual_labour <- ifelse(all_voters$dh3 == "Daily wage labourer/Casual Labour", 1, 0)
unemployed <- ifelse(all_voters$dh3 == "Unemployed/Looking for jobs", 1, 0)

#Asset Ownership & Wealth
asset_cat <- all_voters$revised_assetcat 
ac <-  all_voters$Air_Conditioner
car <- all_voters$Car_Private

#Like or dislike modi
dislike_modi <- ifelse(all_voters$pl1 == "No", 1, 0)
modi_communal_caa <- ifelse(all_voters$pl34 == "Communalisation and Hurting Religious Harmony" | all_voters$pl34 == "Communalisation and Hurting Religious Harmony", 1,0)
modi_unemployment_corrupt <- ifelse(all_voters$pl34 == "Increased Unemployment" | all_voters$pl34 == "Increased Corruption", 1,0)

#Perceptions, Media Ownership and prevailing ideological notions (dummies)
caste_census <- ifelse(all_voters$pov5 == "Yes", 1, 0)
secular <- ifelse(all_voters$c7 == "India is a Secular country where all religions are considered equal", 1, 0)
strongman <- ifelse(all_voters$pl35 ==
"A democracy in which a strong leader can make decisions without interference from the parliament or the courts.", 1, 0)
inequality <- ifelse(all_voters$c1 == "Agree" | all_voters$c1 == "Strongly Agree", 1, 0)
bjp_constitution_change <- ifelse(all_voters$c11 == "Agree" | all_voters$c11 == "Strongly Agree" , 1, 0)
inc_appeasement <- ifelse(all_voters$c12 == "Agree" | all_voters$c12 == "Strongly Agree" , 1, 0)

###Summary Statistics: All Voters

SummaryStats_allvoters <- ies_study_ls24_dta %>% 
  dplyr::select(pl20, bi1, bi11, bi13, revised_religion, dh3, dh5, asset_count, voter_cat1, voter_cat2, pov5, c7, pl35, pl1, revised_assetcat, revised_education, marg_prom) %>% 
  rename("Pref for RG" = pl20,
         "State" = bi1,
         "Presence of Congress" = marg_prom,
         "Urban/Rural" = bi11,
         "Gender" = bi13,
         "Primary Activity" = dh3,
         "Official Caste" = dh5,
         "Voting Pref (LS 24)" = voter_cat1,
         "Voting Pref and like RG (LS24)" = voter_cat2,
         "Caste Census" = pov5,
         "Secular/Hindu" = c7,
         "Leadership" = pl35,
         "Pref for Modi" = pl1,
         "Asset Cateogry (1-4)" = revised_assetcat,
         "Education Category (0-8)" = revised_education ) %>% 
  mutate(Leadership = ifelse(Leadership == "A democracy in which a strong leader can make decisions without interference from the parliament or the courts.", "Strongman", "Consensus Building"))

SummaryStats_allvoters$asset_count <- as.factor(SummaryStats_allvoters$asset_count)

summary_output_allvoters <- dfSummary(SummaryStats_allvoters, 
                            varnumbers = TRUE, 
                            valid.col = FALSE, 
                            title = "Summary Statistics: Dependent Variables (Among All Voters)")

# Render the summary output
print(summary_output_allvoters, file = "dfSummary_DepVariables.html")
includeHTML("dfSummary_DepVariables.html")
Data Frame Summary

Data Frame Summary

SummaryStats_allvoters

Dimensions: 33365 x 17
Duplicates: 2805
No Variable Stats / Values Freqs (% of Valid) Graph Missing
1 Pref for RG [character]
1. No
2. Yes
13276(39.8%)
20089(60.2%)
0 (0.0%)
2 State [character]
1. Uttar Pradesh
2. Maharashtra
3. Bihar
4. West Bengal
5. Tamil Nadu
6. Andhra Pradesh
7. Madhya Pradesh
8. Rajasthan
9. Karnataka
10. Odisha
[ 10 others ]
5453(16.3%)
3282(9.8%)
2999(9.0%)
2881(8.6%)
2244(6.7%)
2057(6.2%)
1712(5.1%)
1667(5.0%)
1535(4.6%)
1423(4.3%)
8112(24.3%)
0 (0.0%)
3 Urban/Rural [character]
1. Rural
2. Urban
24630(73.8%)
8735(26.2%)
0 (0.0%)
4 Gender [character]
1. Female
2. Male
3. Others
15212(45.6%)
18149(54.4%)
4(0.0%)
0 (0.0%)
5 revised_religion [character]
1. Hinduism
2. Islam
3. Other Minorities
4. Refused to Mention
26912(80.7%)
4642(13.9%)
1719(5.2%)
92(0.3%)
0 (0.0%)
6 Primary Activity [character]
1. Aged/Retired
2. Daily wage labourer/Casua
3. Farmer
4. Government Job
5. Housewife
6. Others
7. Private job (Regular sala
8. Self-Employed/Business
9. Student
10. Unemployed/Looking for jo
11. Working
1812(5.4%)
4395(13.2%)
7098(21.3%)
925(2.8%)
8045(24.1%)
551(1.7%)
3567(10.7%)
3203(9.6%)
2006(6.0%)
1762(5.3%)
1(0.0%)
0 (0.0%)
7 Official Caste [character]
1. General
2. Other Backward Class (OBC
3. Scheduled Caste (SC)/Dali
4. Scheduled Tribe (ST)/Adiv
9682(29.0%)
15228(45.6%)
5835(17.5%)
2620(7.9%)
0 (0.0%)
8 asset_count [factor]
1. 0
2. 1
3. 2
4. 3
5. 4
6. 5
7. 6
8. 7
9. 8
10. 9
[ 3 others ]
1869(5.6%)
5735(17.2%)
8178(24.5%)
8033(24.1%)
4384(13.1%)
2322(7.0%)
1301(3.9%)
716(2.1%)
430(1.3%)
296(0.9%)
101(0.3%)
0 (0.0%)
9 Voting Pref (LS 24) [factor]
1. Voted for the Congress
2. Voted for INDIA but not C
3. Voted for the BJP
4. Voted for the NDA but not
5. Voted for the Third Front
6. Voted for Independent Can
7. Don't want to specify
6639(19.9%)
6433(19.3%)
11239(33.7%)
2401(7.2%)
3164(9.5%)
473(1.4%)
3016(9.0%)
0 (0.0%)
10 Voting Pref and like RG (LS24) [factor]
1. Voted for the Congress an
2. Voted for the Congress an
3. Voted for INDIA and like
4. Voted for INDIA and does
5. Voted for the BJP and lik
6. Voted for the BJP and doe
7. Voted for the NDA and lik
8. Voted for the NDA and doe
9. Voted for the Third Front
10. Voted for the Third Front
5786(17.3%)
853(2.6%)
4685(14.0%)
1748(5.2%)
4254(12.7%)
6985(20.9%)
1239(3.7%)
1162(3.5%)
4125(12.4%)
2528(7.6%)
0 (0.0%)
11 Caste Census [character]
1. Can't Say
2. No
3. Yes
6179(18.5%)
5993(18.0%)
21193(63.5%)
0 (0.0%)
12 Secular/Hindu [character]
1. India is a Hindu country
2. India is a Secular countr
6713(20.1%)
26652(79.9%)
0 (0.0%)
13 Leadership [character]
1. Consensus Building
2. Strongman
25582(76.7%)
7783(23.3%)
0 (0.0%)
14 Pref for Modi [character]
1. No
2. Yes
11023(33.0%)
22342(67.0%)
0 (0.0%)
15 Asset Cateogry (1-4) [numeric]
Mean (sd) : 1.7 (0.8)
min ≤ med ≤ max:
1 ≤ 2 ≤ 4
IQR (CV) : 1 (0.5)
1:15782(47.3%)
2:12417(37.2%)
3:4339(13.0%)
4:827(2.5%)
0 (0.0%)
16 Education Category (0-8) [numeric]
Mean (sd) : 3.5 (2.4)
min ≤ med ≤ max:
0 ≤ 4 ≤ 8
IQR (CV) : 3 (0.7)
0:5556(16.7%)
1:2147(6.4%)
2:4156(12.5%)
3:4015(12.0%)
4:4849(14.5%)
5:6105(18.3%)
6:1049(3.1%)
7:4752(14.2%)
8:736(2.2%)
0 (0.0%)
17 Presence of Congress [character]
1. Marginal
2. Prominent
18549(55.6%)
14816(44.4%)
0 (0.0%)

Generated by summarytools 1.0.0 (R version 4.0.3)
2024-10-15

###Cross-tabs: Preference for RG and dependent Variables (Among All Voters)

caste_pl20 <- round(100*prop.table(table(all_voters$pl20, "Caste Categories" = all_voters$dh5), 2),2)
religion_pl20 <- round(100*prop.table(table(all_voters$pl20, "Religion" = all_voters$revised_religion), 2),2)
nu_pl20 <- round(100*prop.table(table(all_voters$pl20, "Nature of Locality" = all_voters$bi11), 2),2)
gender_pl20 <- round(100*prop.table(table(all_voters$pl20, "Gender" = all_voters$bi13), 2),2)
asset_pl20 <- round(100*prop.table(table(all_voters$pl20, "Assent Ranks" = all_voters$revised_assetcat), 2),2)
primact_pl20 <- round(100*prop.table(table(all_voters$pl20, "Primary Activity" = all_voters$dh3), 2),2)
secular_pl20 <- round(100*prop.table(table(all_voters$pl20, "Secular/Hindu Country" = all_voters$c7), 2),2)
castecensus_pl20 <- round(100*prop.table(table(all_voters$pl20, "Opinion on Caste Census" = all_voters$pov5), 2),2)
leadership_pl20 <- round(100*prop.table(table(all_voters$pl20, "Nature of Political Leadership" = all_voters$pl35), 2),2)

print(caste_pl20)
##      Caste Categories
##       General Other Backward Class (OBC) Scheduled Caste (SC)/Dalit
##   No    44.42                      37.35                      37.58
##   Yes   55.58                      62.65                      62.42
##      Caste Categories
##       Scheduled Tribe (ST)/Adivasi
##   No                         42.10
##   Yes                        57.90
print(religion_pl20)
##      Religion
##       Hinduism Islam Other Minorities Refused to Mention
##   No     43.95 16.74            37.26              41.30
##   Yes    56.05 83.26            62.74              58.70
print(nu_pl20)
##      Nature of Locality
##       Rural Urban
##   No  40.49 37.91
##   Yes 59.51 62.09
print(gender_pl20)
##      Gender
##       Female  Male Others
##   No   39.63 39.97  25.00
##   Yes  60.37 60.03  75.00
print(asset_pl20)
##      Assent Ranks
##           1     2     3     4
##   No  39.55 39.92 39.18 46.55
##   Yes 60.45 60.08 60.82 53.45
print(primact_pl20)
##      Primary Activity
##       Aged/Retired Daily wage labourer/Casual Labour Farmer Government Job
##   No         37.52                             35.05  41.10          43.89
##   Yes        62.48                             64.95  58.90          56.11
##      Primary Activity
##       Housewife Others Private job (Regular salaried) Self-Employed/Business
##   No      40.87  42.29                          40.72                  39.55
##   Yes     59.13  57.71                          59.28                  60.45
##      Primary Activity
##       Student Unemployed/Looking for jobs Working
##   No    41.17                       38.23    0.00
##   Yes   58.83                       61.77  100.00
print(secular_pl20)
##      Secular/Hindu Country
##       India is a Hindu country
##   No                     53.53
##   Yes                    46.47
##      Secular/Hindu Country
##       India is a Secular country where all religions are considered equal
##   No                                                                36.36
##   Yes                                                               63.64
print(castecensus_pl20)
##      Opinion on Caste Census
##       Can't Say    No   Yes
##   No      48.16 48.11 35.03
##   Yes     51.84 51.89 64.97
print(leadership_pl20)
##      Nature of Political Leadership
##       A democracy in which a strong leader can make decisions without interference from the parliament or the courts.
##   No                                                                                                            46.70
##   Yes                                                                                                           53.30
##      Nature of Political Leadership
##       A democracy in which elected representatives decide what becomes law.
##   No                                                                  37.71
##   Yes                                                                 62.29

###Model 1a: Preference for RG and Age, Gender (Dummy) and Nature of Locality (Dummy); Among All Voters

logit.fit.1a <- glm(y0 ~ s_ + age + female + rural + level_of_education, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.1a)
## 
## Call:
## glm(formula = y0 ~ s_ + age + female + rural + level_of_education, 
##     family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.8276  -1.2676   0.8259   1.0186   1.4838  
## 
## Coefficients:
##                      Estimate Std. Error z value Pr(>|z|)    
## (Intercept)         0.7294621  0.0811730   8.987  < 2e-16 ***
## s_Andhra Pradesh    0.9714620  0.0756116  12.848  < 2e-16 ***
## s_Assam             0.2185277  0.1009430   2.165 0.030398 *  
## s_Bihar             0.1544133  0.0675534   2.286 0.022266 *  
## s_Chhattisgarh      0.8913711  0.1015717   8.776  < 2e-16 ***
## s_Delhi             0.4547220  0.1294769   3.512 0.000445 ***
## s_Haryana           0.5789273  0.1075978   5.380 7.43e-08 ***
## s_Himachal Pradesh  0.4719437  0.1226072   3.849 0.000118 ***
## s_Jharkhand        -0.0506328  0.0815140  -0.621 0.534498    
## s_Karnataka        -0.0137947  0.0760398  -0.181 0.856043    
## s_Kerala            1.0807384  0.0908125  11.901  < 2e-16 ***
## s_Madhya Pradesh    0.0956603  0.0745663   1.283 0.199531    
## s_Maharashtra       0.5389744  0.0673291   8.005 1.19e-15 ***
## s_Odisha            0.6248329  0.0798000   7.830 4.88e-15 ***
## s_Punjab           -0.0765291  0.0903644  -0.847 0.397054    
## s_Rajasthan         0.6904003  0.0772953   8.932  < 2e-16 ***
## s_Tamil Nadu        0.7941992  0.0731610  10.856  < 2e-16 ***
## s_Telangana         0.3754902  0.0809897   4.636 3.55e-06 ***
## s_Uttar Pradesh     0.2584806  0.0627962   4.116 3.85e-05 ***
## s_West Bengal      -0.3991260  0.0677233  -5.893 3.78e-09 ***
## age                -0.0056888  0.0009061  -6.278 3.43e-10 ***
## female             -0.0464693  0.0232883  -1.995 0.046001 *  
## rural              -0.1542022  0.0280294  -5.501 3.77e-08 ***
## level_of_education -0.0755419  0.0058851 -12.836  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 44783  on 33308  degrees of freedom
## Residual deviance: 43551  on 33285  degrees of freedom
## AIC: 43599
## 
## Number of Fisher Scoring iterations: 4

###Model 1b: Preference for RG ~ Religion (Ref == Hinduism), Caste (Ref == General); Among All Voters

logit.fit.1b <- glm(y0 ~ caste_religion, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.1b)
## 
## Call:
## glm(formula = y0 ~ caste_religion, family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.8906  -1.3140   0.6054   1.0467   1.2045  
## 
## Coefficients:
##                             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                  0.51230    0.04860  10.541  < 2e-16 ***
## caste_religionHindu and OBC -0.19675    0.05193  -3.789 0.000151 ***
## caste_religionHindu and SC  -0.01746    0.05663  -0.308 0.757800    
## caste_religionHindu and ST  -0.22993    0.06364  -3.613 0.000303 ***
## caste_religionHindu and UC  -0.57579    0.05405 -10.652  < 2e-16 ***
## caste_religionMuslim         1.09171    0.06253  17.459  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 44783  on 33308  degrees of freedom
## Residual deviance: 43169  on 33303  degrees of freedom
## AIC: 43181
## 
## Number of Fisher Scoring iterations: 4

###Model 1c: Preference for RG ~ Primary Acitivty Dummies: Farmers, Casual Labourers, Unemployed (Among All Voters)

logit.fit.1c <- glm(y0 ~ farmers + unemployed + casual_labour, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.1c)
## 
## Call:
## glm(formula = y0 ~ farmers + unemployed + casual_labour, family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.4481  -1.3438   0.9815   1.0196   1.0289  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)    0.38310    0.01438  26.649  < 2e-16 ***
## farmers       -0.02330    0.02810  -0.829   0.4070    
## unemployed     0.09690    0.05114   1.895   0.0581 .  
## casual_labour  0.23379    0.03474   6.729 1.71e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 44783  on 33308  degrees of freedom
## Residual deviance: 44730  on 33305  degrees of freedom
## AIC: 44738
## 
## Number of Fisher Scoring iterations: 4

###Model 1d: Preference for RG ~ Assent Rank (Numeric Range; c(1,5)), Ownership of AC (dummy), Ownership of Car (dummy); Among All Voters

logit.fit.1d <- glm(y0 ~ asset_cat, family=binomial(link = "logit"))
# Summary of the model
summary(logit.fit.1d)
## 
## Call:
## glm(formula = y0 ~ asset_cat, family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.365  -1.354   1.001   1.011   1.031  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  0.45665    0.02679  17.046   <2e-16 ***
## asset_cat   -0.02538    0.01424  -1.783   0.0746 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 44783  on 33308  degrees of freedom
## Residual deviance: 44780  on 33307  degrees of freedom
## AIC: 44784
## 
## Number of Fisher Scoring iterations: 4

###Model 1e: Preference for RG ~ Political Positions: Secular/Hindu Country (dummy), Leadership (dummy), Caste Census (dummy), Likes Modi (dummy); Among All Voters

logit.fit.1e <- glm(y0 ~ secular + strongman + caste_census + bjp_constitution_change + inequality + inc_appeasement, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.1e)
## 
## Call:
## glm(formula = y0 ~ secular + strongman + caste_census + bjp_constitution_change + 
##     inequality + inc_appeasement, family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.8234  -1.1832   0.7845   0.9781   1.8768  
## 
## Coefficients:
##                         Estimate Std. Error z value Pr(>|z|)    
## (Intercept)             -0.73923    0.03584  -20.62   <2e-16 ***
## secular                  0.62304    0.02876   21.66   <2e-16 ***
## strongman               -0.23743    0.02757   -8.61   <2e-16 ***
## caste_census             0.41109    0.02466   16.67   <2e-16 ***
## bjp_constitution_change  0.43129    0.02560   16.85   <2e-16 ***
## inequality               0.72591    0.02697   26.92   <2e-16 ***
## inc_appeasement         -0.59609    0.02540  -23.46   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 44783  on 33308  degrees of freedom
## Residual deviance: 42085  on 33302  degrees of freedom
## AIC: 42099
## 
## Number of Fisher Scoring iterations: 4

###Model 1f: Preference for RG ~ Biggest Failure of BJP: Communalisation, Unemoployment (dummies); Among All Voters

logit.fit.1f <- glm(y0 ~ modi_communal_caa + modi_unemployment_corrupt, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.1f)
## 
## Call:
## glm(formula = y0 ~ modi_communal_caa + modi_unemployment_corrupt, 
##     family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3916  -1.3916   0.9774   0.9774   1.1498  
## 
## Coefficients:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                0.06526    0.02831   2.305   0.0211 *  
## modi_communal_caa          0.31587    0.04437   7.119 1.08e-12 ***
## modi_unemployment_corrupt  0.42539    0.03119  13.639  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 44783  on 33308  degrees of freedom
## Residual deviance: 44598  on 33306  degrees of freedom
## AIC: 44604
## 
## Number of Fisher Scoring iterations: 4

###Model 1g: Preference for RG ~ All dependent variables; Among All Voters

logit.fit.1g <- glm(y0 ~ s_  + age + female + rural + level_of_education + caste_religion
                   + farmers + unemployed + casual_labour 
                   + asset_cat + secular + strongman + caste_census + bjp_constitution_change + inequality + inc_appeasement +                     modi_communal_caa + modi_unemployment_corrupt, family=binomial(link = "logit"))
summary(logit.fit.1g)
## 
## Call:
## glm(formula = y0 ~ s_ + age + female + rural + level_of_education + 
##     caste_religion + farmers + unemployed + casual_labour + asset_cat + 
##     secular + strongman + caste_census + bjp_constitution_change + 
##     inequality + inc_appeasement + modi_communal_caa + modi_unemployment_corrupt, 
##     family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -2.715  -1.089   0.607   0.944   2.295  
## 
## Coefficients:
##                               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                 -1.0956076  0.1203229  -9.106  < 2e-16 ***
## s_Andhra Pradesh             1.0500527  0.0807993  12.996  < 2e-16 ***
## s_Assam                      0.4080007  0.1116602   3.654 0.000258 ***
## s_Bihar                      0.1336326  0.0721541   1.852 0.064020 .  
## s_Chhattisgarh               1.0609826  0.1077315   9.848  < 2e-16 ***
## s_Delhi                      0.2508893  0.1378201   1.820 0.068696 .  
## s_Haryana                    0.6399469  0.1147421   5.577 2.44e-08 ***
## s_Himachal Pradesh           0.8490628  0.1313510   6.464 1.02e-10 ***
## s_Jharkhand                 -0.2379423  0.0876433  -2.715 0.006630 ** 
## s_Karnataka                  0.1213241  0.0823076   1.474 0.140473    
## s_Kerala                     0.8777325  0.0999156   8.785  < 2e-16 ***
## s_Madhya Pradesh             0.2392037  0.0795950   3.005 0.002654 ** 
## s_Maharashtra                0.6112641  0.0717192   8.523  < 2e-16 ***
## s_Odisha                     0.6417984  0.0836730   7.670 1.72e-14 ***
## s_Punjab                    -0.0464196  0.1056075  -0.440 0.660265    
## s_Rajasthan                  0.6829498  0.0818888   8.340  < 2e-16 ***
## s_Tamil Nadu                 0.9398003  0.0784850  11.974  < 2e-16 ***
## s_Telangana                  0.3746419  0.0860975   4.351 1.35e-05 ***
## s_Uttar Pradesh              0.2458897  0.0674743   3.644 0.000268 ***
## s_West Bengal               -0.5315247  0.0750142  -7.086 1.38e-12 ***
## age                          0.0002960  0.0009899   0.299 0.764916    
## female                       0.0289765  0.0265743   1.090 0.275540    
## rural                       -0.0363963  0.0316347  -1.151 0.249930    
## level_of_education          -0.0301499  0.0068515  -4.400 1.08e-05 ***
## caste_religionHindu and OBC -0.2413544  0.0639914  -3.772 0.000162 ***
## caste_religionHindu and SC   0.0093337  0.0686604   0.136 0.891869    
## caste_religionHindu and ST  -0.1856940  0.0765214  -2.427 0.015237 *  
## caste_religionHindu and UC  -0.4609234  0.0654118  -7.046 1.83e-12 ***
## caste_religionMuslim         1.2992956  0.0748568  17.357  < 2e-16 ***
## farmers                      0.0589364  0.0342363   1.721 0.085167 .  
## unemployed                   0.1162403  0.0570100   2.039 0.041456 *  
## casual_labour                0.0671706  0.0409747   1.639 0.101147    
## asset_cat                    0.0027980  0.0174487   0.160 0.872601    
## secular                      0.4896355  0.0309346  15.828  < 2e-16 ***
## strongman                   -0.2576714  0.0293740  -8.772  < 2e-16 ***
## caste_census                 0.4543175  0.0264347  17.186  < 2e-16 ***
## bjp_constitution_change      0.4155136  0.0269641  15.410  < 2e-16 ***
## inequality                   0.5843976  0.0286066  20.429  < 2e-16 ***
## inc_appeasement             -0.5294649  0.0267244 -19.812  < 2e-16 ***
## modi_communal_caa            0.1894569  0.0495635   3.823 0.000132 ***
## modi_unemployment_corrupt    0.3875439  0.0352925  10.981  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 44783  on 33308  degrees of freedom
## Residual deviance: 39478  on 33268  degrees of freedom
## AIC: 39560
## 
## Number of Fisher Scoring iterations: 4

###Summary Table: Model 1

se_list <- list(rep(NA, length(coef(logit.fit.1a))), 
                rep(NA, length(coef(logit.fit.1b))), 
                rep(NA, length(coef(logit.fit.1c))), 
                rep(NA, length(coef(logit.fit.1d))), 
                rep(NA, length(coef(logit.fit.1e))), 
                rep(NA, length(coef(logit.fit.1f))),
                rep(NA, length(coef(logit.fit.1g))))

predictor_labels <- c( "Andhra Pradesh", "Assam", "Bihar", "Chhattisgarh", "Delhi", "Haryana", "Himachal Pradesh", "Jharkhand",  "Karnataka", "Kerala", "Madhya Pradesh", "Maharashtra", "Odisha", "Punjab", "Rajasthan", "Tamil Nadu", 
"Telangana", "Uttar Pradesh", "West Bengal", "Age","Female","Rural", "Level of Education", "Hindu OBC", "Hindu SC", "Hindu ST", "Hindu UC", "Muslims", "Farmers", "Unemployed", "Casual Labour", "Asset Category", "Secular", "Strongman Politics", "Support for Caste Census", "BJP Constitution Change", "High Inequality", "Congress Appeasement Politics", "Modi and Communal Politics", "Modi and Unemployment", "Constant")

# Use stargazer and pass the cleaned names as the custom coefficient labels
summary_model1 <- stargazer(logit.fit.1a, logit.fit.1b, logit.fit.1c, logit.fit.1d, logit.fit.1e, logit.fit.1f, logit.fit.1g,
                             type = "text",          
                             title = "Characterising Potential Congress Voters",  # Table title
                             dep.var.caption = "Model1: Preference for Rahul Gandhi among All Voters",  # Caption for the dependent variable
                             p.auto = FALSE,           # Automatically print p-values
                             p.style = "asterisk",    # Style of p-value stars (* for coefficients only)
                             column.labels = c("1a", "1b", "1c", "1d", "1e", "1f", "1g"),
                             dep.var.labels = c("Logistic Regression Estimates/Coefficiants"), 
                             single.row = TRUE,       # Display statistics in a single row
                             digits = 2,              # Number of digits to display
                             se = se_list,
                            covariate.labels = predictor_labels
)
## 
## Characterising Potential Congress Voters
## ==========================================================================================================
##                                           Model1: Preference for Rahul Gandhi among All Voters            
##                               ----------------------------------------------------------------------------
##                                                Logistic Regression Estimates/Coefficiants                 
##                                   1a         1b         1c         1d         1e         1f         1g    
##                                  (1)        (2)        (3)        (4)        (5)        (6)        (7)    
## ----------------------------------------------------------------------------------------------------------
## Andhra Pradesh                 0.97***                                                           1.05***  
## Assam                           0.22**                                                           0.41***  
## Bihar                           0.15**                                                            0.13*   
## Chhattisgarh                   0.89***                                                           1.06***  
## Delhi                          0.45***                                                            0.25*   
## Haryana                        0.58***                                                           0.64***  
## Himachal Pradesh               0.47***                                                           0.85***  
## Jharkhand                       -0.05                                                            -0.24*** 
## Karnataka                       -0.01                                                              0.12   
## Kerala                         1.08***                                                           0.88***  
## Madhya Pradesh                   0.10                                                            0.24***  
## Maharashtra                    0.54***                                                           0.61***  
## Odisha                         0.62***                                                           0.64***  
## Punjab                          -0.08                                                             -0.05   
## Rajasthan                      0.69***                                                           0.68***  
## Tamil Nadu                     0.79***                                                           0.94***  
## Telangana                      0.38***                                                           0.37***  
## Uttar Pradesh                  0.26***                                                           0.25***  
## West Bengal                    -0.40***                                                          -0.53*** 
## Age                            -0.01***                                                           0.0003  
## Female                         -0.05**                                                             0.03   
## Rural                          -0.15***                                                           -0.04   
## Level of Education             -0.08***                                                          -0.03*** 
## Hindu OBC                                 -0.20***                                               -0.24*** 
## Hindu SC                                   -0.02                                                   0.01   
## Hindu ST                                  -0.23***                                               -0.19**  
## Hindu UC                                  -0.58***                                               -0.46*** 
## Muslims                                   1.09***                                                1.30***  
## Farmers                                               -0.02                                       0.06*   
## Unemployed                                            0.10*                                       0.12**  
## Casual Labour                                        0.23***                                       0.07   
## Asset Category                                                   -0.03*                           0.003   
## Secular                                                                    0.62***               0.49***  
## Strongman Politics                                                         -0.24***              -0.26*** 
## Support for Caste Census                                                   0.41***               0.45***  
## BJP Constitution Change                                                    0.43***               0.42***  
## High Inequality                                                            0.73***               0.58***  
## Congress Appeasement Politics                                              -0.60***              -0.53*** 
## Modi and Communal Politics                                                            0.32***    0.19***  
## Modi and Unemployment                                                                 0.43***    0.39***  
## Constant                       0.73***    0.51***    0.38***    0.46***    -0.74***    0.07**    -1.10*** 
## ----------------------------------------------------------------------------------------------------------
## Observations                    33,309     33,309     33,309     33,309     33,309     33,309     33,309  
## Log Likelihood                -21,775.49 -21,584.31 -22,365.03 -22,390.13 -21,042.66 -22,298.81 -19,738.87
## Akaike Inf. Crit.             43,598.98  43,180.62  44,738.06  44,784.26  42,099.32  44,603.61  39,559.73 
## ==========================================================================================================
## Note:                                                                          *p<0.1; **p<0.05; ***p<0.01
## 
## Characterising Potential Congress Voters
## ========
## asterisk
## --------

##Model 2: Preference for RG among non-congress voters

###Defining Dependent & Independent Variables (Among Non-Congress Voters)

###Summary Stats: Among Non-Congress Voters

##Summary Stats on dependent variables
SummaryStats_DependentVariables <- non_congress %>% 
  dplyr::select(pl20, bi1, bi11, bi13, revised_religion, dh3, dh5, asset_count, revised_assetcat, voter_cat1, voter_cat2, pov5, c7, pl34, pl35, pl1, caste_rel, marg_prom) %>% 
  rename("Pref for RG" = pl20,
         "State" = bi1,
         "Urban/Rural" = bi11,
         "Gender" = bi13,
         "Primary Activity" = dh3,
         "Official Caste" = dh5,
         "Voting Pref (LS 24)" = voter_cat1,
         "Voting Pref and like RG (LS24)" = voter_cat2,
         "Caste Census" = pov5,
         "Secular/Hindu" = c7,
         "Leadership" = pl35,
         "Pref for Modi" = pl1,
         "Asset Cateogry (1-4)" = revised_assetcat,
         "Presence of Congress" = marg_prom,
         "Failures of the BJP" = pl34) %>% 
  mutate(Leadership = ifelse(Leadership == "A democracy in which a strong leader can make decisions without interference from the parliament or the courts.", "Strongman", "Consensus Building"))

SummaryStats_DependentVariables$asset_count <- as.factor(SummaryStats_DependentVariables$asset_count)

summary_output <- dfSummary(SummaryStats_DependentVariables, 
                            varnumbers = TRUE, 
                            valid.col = FALSE, 
                            title = "Summary Statistics: Dependent Variables (Among Non-Congress Voters)")

# Render the summary output
print(summary_output, file = "dfSummary_DepVariables.html")
includeHTML("dfSummary_DepVariables.html")
Data Frame Summary

Data Frame Summary

SummaryStats_DependentVariables

Dimensions: 26683 x 18
Duplicates: 4160
No Variable Stats / Values Freqs (% of Valid) Graph Missing
1 Pref for RG [character]
1. No
2. Yes
12410(46.5%)
14273(53.5%)
0 (0.0%)
2 State [factor]
1. Gujarat
2. Andhra Pradesh
3. Assam
4. Bihar
5. Chhattisgarh
6. Delhi
7. Haryana
8. Himachal Pradesh
9. Jharkhand
10. Karnataka
[ 10 others ]
1006(3.8%)
1981(7.4%)
517(1.9%)
2700(10.1%)
432(1.6%)
253(0.9%)
288(1.1%)
215(0.8%)
856(3.2%)
854(3.2%)
17581(65.9%)
0 (0.0%)
3 Urban/Rural [character]
1. Rural
2. Urban
19898(74.6%)
6785(25.4%)
0 (0.0%)
4 Gender [character]
1. Female
2. Male
3. Others
12240(45.9%)
14440(54.1%)
3(0.0%)
0 (0.0%)
5 revised_religion [character]
1. Hinduism
2. Islam
3. Other Minorities
4. Refused to Mention
22423(84.0%)
2914(10.9%)
1267(4.7%)
79(0.3%)
0 (0.0%)
6 Primary Activity [character]
1. Aged/Retired
2. Daily wage labourer/Casua
3. Farmer
4. Government Job
5. Housewife
6. Others
7. Private job (Regular sala
8. Self-Employed/Business
9. Student
10. Unemployed/Looking for jo
1404(5.3%)
3442(12.9%)
5621(21.1%)
737(2.8%)
6577(24.6%)
411(1.5%)
2933(11.0%)
2557(9.6%)
1601(6.0%)
1400(5.2%)
0 (0.0%)
7 Official Caste [character]
1. General
2. Other Backward Class (OBC
3. Scheduled Caste (SC)/Dali
4. Scheduled Tribe (ST)/Adiv
7944(29.8%)
12256(45.9%)
4500(16.9%)
1983(7.4%)
0 (0.0%)
8 asset_count [factor]
1. 0
2. 1
3. 2
4. 3
5. 4
6. 5
7. 6
8. 7
9. 8
10. 9
[ 3 others ]
1306(4.9%)
4418(16.6%)
6525(24.5%)
6532(24.5%)
3571(13.4%)
1871(7.0%)
1115(4.2%)
623(2.3%)
378(1.4%)
265(1.0%)
79(0.3%)
0 (0.0%)
9 Asset Cateogry (1-4) [numeric]
Mean (sd) : 1.7 (0.8)
min ≤ med ≤ max:
1 ≤ 2 ≤ 4
IQR (CV) : 1 (0.5)
1:12249(45.9%)
2:10103(37.9%)
3:3609(13.5%)
4:722(2.7%)
0 (0.0%)
10 Voting Pref (LS 24) [factor]
1. Voted for the Congress
2. Voted for INDIA but not C
3. Voted for the BJP
4. Voted for the NDA but not
5. Voted for the Third Front
6. Voted for Independent Can
7. Don't want to specify
0(0.0%)
6423(24.1%)
11224(42.1%)
2401(9.0%)
3156(11.8%)
473(1.8%)
3006(11.3%)
0 (0.0%)
11 Voting Pref and like RG (LS24) [factor]
1. Voted for the Congress an
2. Voted for the Congress an
3. Voted for INDIA and like
4. Voted for INDIA and does
5. Voted for the BJP and lik
6. Voted for the BJP and doe
7. Voted for the NDA and lik
8. Voted for the NDA and doe
9. Voted for the Third Front
10. Voted for the Third Front
0(0.0%)
0(0.0%)
4675(17.5%)
1748(6.6%)
4247(15.9%)
6977(26.1%)
1239(4.6%)
1162(4.4%)
4112(15.4%)
2523(9.5%)
0 (0.0%)
12 Caste Census [character]
1. Can't Say
2. No
3. Yes
4971(18.6%)
4959(18.6%)
16753(62.8%)
0 (0.0%)
13 Secular/Hindu [character]
1. India is a Hindu country
2. India is a Secular countr
5586(20.9%)
21097(79.1%)
0 (0.0%)
14 Failures of the BJP [character]
1. CAA
2. Communalisation and Hurti
3. Hurt Global Reputation
4. Increased Corruption
5. Increased Unemployment
3478(13.0%)
2985(11.2%)
716(2.7%)
3272(12.3%)
16232(60.8%)
0 (0.0%)
15 Leadership [character]
1. Consensus Building
2. Strongman
20270(76.0%)
6413(24.0%)
0 (0.0%)
16 Pref for Modi [character]
1. No
2. Yes
7125(26.7%)
19558(73.3%)
0 (0.0%)
17 caste_rel [factor]
1. Others/Refused to Mention
2. Hindu and OBC
3. Hindu and SC
4. Hindu and ST
5. Hindu and UC
6. Muslim
1346(5.0%)
10345(38.8%)
3952(14.8%)
1839(6.9%)
6287(23.6%)
2914(10.9%)
0 (0.0%)
18 Presence of Congress [character]
1. Marginal
2. Prominent
16630(62.3%)
10053(37.7%)
0 (0.0%)

Generated by summarytools 1.0.0 (R version 4.0.3)
2024-10-15

###Cross-tabs: Preference for RG and dependent Variables (Among Non-Congress Voters)

caste_pl20 <- round(100*prop.table(table(non_congress$pl20, "Caste Categories" = non_congress$dh5), 2),2)
religion_pl20 <- round(100*prop.table(table(non_congress$pl20, "Religion" = non_congress$revised_religion), 2),2)
nu_pl20 <- round(100*prop.table(table(non_congress$pl20, "Nature of Locality" = non_congress$bi11), 2),2)
gender_pl20 <- round(100*prop.table(table(non_congress$pl20, "Gender" = non_congress$bi13), 2),2)
asset_pl20 <- round(100*prop.table(table(non_congress$pl20, "Assent Ranks" = non_congress$revised_assetcat), 2),2)
primact_pl20 <- round(100*prop.table(table(non_congress$pl20, "Primary Activity" = non_congress$dh3), 2),2)
secular_pl20 <- round(100*prop.table(table(non_congress$pl20, "Secular/Hindu Country" = non_congress$c7), 2),2)
castecensus_pl20 <- round(100*prop.table(table(non_congress$pl20, "Opinion on Caste Census" = non_congress$pov5), 2),2)
leadership_pl20 <- round(100*prop.table(table(non_congress$pl20, "Nature of Political Leadership" = non_congress$pl35), 2),2)

print(caste_pl20)
##      Caste Categories
##       General Other Backward Class (OBC) Scheduled Caste (SC)/Dalit
##   No    51.23                      43.44                      44.58
##   Yes   48.77                      56.56                      55.42
##      Caste Categories
##       Scheduled Tribe (ST)/Adivasi
##   No                         50.93
##   Yes                        49.07
print(religion_pl20)
##      Religion
##       Hinduism Islam Other Minorities Refused to Mention
##   No     49.70 22.24            45.70              48.10
##   Yes    50.30 77.76            54.30              51.90
print(nu_pl20)
##      Nature of Locality
##       Rural Urban
##   No  46.82 45.59
##   Yes 53.18 54.41
print(gender_pl20)
##      Gender
##       Female  Male Others
##   No   45.99 46.95  33.33
##   Yes  54.01 53.05  66.67
print(asset_pl20)
##      Assent Ranks
##           1     2     3     4
##   No  46.43 46.81 45.14 50.55
##   Yes 53.57 53.19 54.86 49.45
print(primact_pl20)
##      Primary Activity
##       Aged/Retired Daily wage labourer/Casual Labour Farmer Government Job
##   No         44.16                             41.55  47.96          50.07
##   Yes        55.84                             58.45  52.04          49.93
##      Primary Activity
##       Housewife Others Private job (Regular salaried) Self-Employed/Business
##   No      47.54  52.31                          46.91                  46.03
##   Yes     52.46  47.69                          53.09                  53.97
##      Primary Activity
##       Student Unemployed/Looking for jobs
##   No    48.09                       45.00
##   Yes   51.91                       55.00
print(secular_pl20)
##      Secular/Hindu Country
##       India is a Hindu country
##   No                     58.36
##   Yes                    41.64
##      Secular/Hindu Country
##       India is a Secular country where all religions are considered equal
##   No                                                                43.37
##   Yes                                                               56.63
print(castecensus_pl20)
##      Opinion on Caste Census
##       Can't Say    No   Yes
##   No      55.28 52.95 42.00
##   Yes     44.72 47.05 58.00
print(leadership_pl20)
##      Nature of Political Leadership
##       A democracy in which a strong leader can make decisions without interference from the parliament or the courts.
##   No                                                                                                            51.88
##   Yes                                                                                                           48.12
##      Nature of Political Leadership
##       A democracy in which elected representatives decide what becomes law.
##   No                                                                  44.81
##   Yes                                                                 55.19

###Model 2a: Preference for RG and Age, Gender (Dummy) and Nature of Locality (Dummy); Among Non-Congress Voters

logit.fit.2a <- glm(y0 ~ s_ + age + female + rural + level_of_education, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.2a)
## 
## Call:
## glm(formula = y0 ~ s_ + age + female + rural + level_of_education, 
##     family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7913  -1.1870   0.7819   1.0946   1.7416  
## 
## Coefficients:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)         0.261196   0.091689   2.849  0.00439 ** 
## s_Andhra Pradesh    1.356216   0.082120  16.515  < 2e-16 ***
## s_Assam             0.449406   0.109346   4.110 3.96e-05 ***
## s_Bihar             0.366020   0.074743   4.897 9.73e-07 ***
## s_Chhattisgarh      0.712595   0.117683   6.055 1.40e-09 ***
## s_Delhi             0.457391   0.143528   3.187  0.00144 ** 
## s_Haryana           0.260288   0.134414   1.936  0.05281 .  
## s_Himachal Pradesh  0.247524   0.151782   1.631  0.10293    
## s_Jharkhand        -0.264093   0.095202  -2.774  0.00554 ** 
## s_Karnataka        -0.651562   0.099192  -6.569 5.08e-11 ***
## s_Kerala            0.979360   0.103955   9.421  < 2e-16 ***
## s_Madhya Pradesh    0.271907   0.084424   3.221  0.00128 ** 
## s_Maharashtra       0.604568   0.075754   7.981 1.46e-15 ***
## s_Odisha            0.827580   0.086775   9.537  < 2e-16 ***
## s_Punjab           -0.103790   0.105154  -0.987  0.32363    
## s_Rajasthan        -0.011462   0.093471  -0.123  0.90240    
## s_Tamil Nadu        1.134063   0.079800  14.211  < 2e-16 ***
## s_Telangana         0.045431   0.097469   0.466  0.64114    
## s_Uttar Pradesh     0.479388   0.070210   6.828 8.62e-12 ***
## s_West Bengal      -0.164177   0.075233  -2.182  0.02909 *  
## age                -0.005393   0.001008  -5.348 8.88e-08 ***
## female             -0.019307   0.025776  -0.749  0.45384    
## rural              -0.091869   0.031255  -2.939  0.00329 ** 
## level_of_education -0.066942   0.006547 -10.226  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 36860  on 26682  degrees of freedom
## Residual deviance: 35370  on 26659  degrees of freedom
## AIC: 35418
## 
## Number of Fisher Scoring iterations: 4

###Model 2b: Preference for RG ~ Religion (Ref == Hinduism), Caste (Ref == General); Among Non-Congress Voters

logit.fit.2b <- glm(y0 ~ caste_religion, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.2b)
## 
## Call:
## glm(formula = y0 ~ caste_religion, family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7340  -1.2215   0.7092   1.1339   1.2843  
## 
## Coefficients:
##                             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                  0.16680    0.05470   3.049  0.00229 ** 
## caste_religionHindu and OBC -0.06367    0.05814  -1.095  0.27347    
## caste_religionHindu and SC   0.05577    0.06338   0.880  0.37891    
## caste_religionHindu and ST  -0.23535    0.07190  -3.273  0.00106 ** 
## caste_religionHindu and UC  -0.41461    0.06032  -6.873 6.27e-12 ***
## caste_religionMuslim         1.08508    0.07055  15.381  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 36860  on 26682  degrees of freedom
## Residual deviance: 35856  on 26677  degrees of freedom
## AIC: 35868
## 
## Number of Fisher Scoring iterations: 4

##Model 2c: Preference for RG ~ Primary Acitivty Dummies: Farmers, Casual Labourers, Unemployed (Among Non-Congress Voters)

logit.fit.2c <- glm(y0 ~ farmers + unemployed + casual_labour, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.2c)
## 
## Call:
## glm(formula = y0 ~ farmers + unemployed + casual_labour, family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.325  -1.226   1.036   1.130   1.143  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)    0.11257    0.01573   7.157 8.24e-13 ***
## farmers       -0.03105    0.03099  -1.002    0.316    
## unemployed     0.08810    0.05598   1.574    0.116    
## casual_labour  0.22888    0.03799   6.024 1.70e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 36860  on 26682  degrees of freedom
## Residual deviance: 36817  on 26679  degrees of freedom
## AIC: 36825
## 
## Number of Fisher Scoring iterations: 3

###Model 2d: Preference for RG ~ Assent Rank (Numeric Range; c(1,5)), Ownership of AC (dummy), Ownership of Car (dummy); Among Non-Congress Voters

logit.fit.2d <- glm(y0 ~ asset_cat, family=binomial(link = "logit"))
# Summary of the model
summary(logit.fit.2d)
## 
## Call:
## glm(formula = y0 ~ asset_cat, family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.239  -1.237   1.117   1.119   1.123  
## 
## Coefficients:
##              Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  0.147643   0.029441   5.015 5.31e-07 ***
## asset_cat   -0.004494   0.015464  -0.291    0.771    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 36860  on 26682  degrees of freedom
## Residual deviance: 36860  on 26681  degrees of freedom
## AIC: 36864
## 
## Number of Fisher Scoring iterations: 3

###Model 2e: Preference for RG ~ Political Positions: Secular/Hindu Country (dummy), Leadership (dummy), Caste Census (dummy), Likes Modi (dummy); Among Non-Congress Voters

logit.fit.2e <- glm(y0 ~ secular + strongman + caste_census + bjp_constitution_change + inequality + inc_appeasement, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.2e)
## 
## Call:
## glm(formula = y0 ~ secular + strongman + caste_census + bjp_constitution_change + 
##     inequality + inc_appeasement, family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.6621  -1.1552   0.7607   1.0446   1.9078  
## 
## Coefficients:
##                         Estimate Std. Error z value Pr(>|z|)    
## (Intercept)             -0.97315    0.03967 -24.529  < 2e-16 ***
## secular                  0.55266    0.03161  17.486  < 2e-16 ***
## strongman               -0.16901    0.03012  -5.611 2.01e-08 ***
## caste_census             0.34832    0.02707  12.866  < 2e-16 ***
## bjp_constitution_change  0.42292    0.02799  15.111  < 2e-16 ***
## inequality               0.74125    0.02962  25.029  < 2e-16 ***
## inc_appeasement         -0.50086    0.02780 -18.020  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 36860  on 26682  degrees of freedom
## Residual deviance: 34931  on 26676  degrees of freedom
## AIC: 34945
## 
## Number of Fisher Scoring iterations: 4

###Model 2f: Preference for RG ~ Biggest Failure of BJP: Communalisation, Unemoployment (dummies); Among Non-Congress Voters

logit.fit.2f <- glm(y0 ~ modi_communal_caa + modi_unemployment_corrupt, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.2f)
## 
## Call:
## glm(formula = y0 ~ modi_communal_caa + modi_unemployment_corrupt, 
##     family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.257  -1.256   1.100   1.100   1.218  
## 
## Coefficients:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)               -0.09449    0.03092  -3.056  0.00224 ** 
## modi_communal_caa          0.27927    0.04804   5.814 6.10e-09 ***
## modi_unemployment_corrupt  0.27815    0.03410   8.157 3.43e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 36860  on 26682  degrees of freedom
## Residual deviance: 36792  on 26680  degrees of freedom
## AIC: 36798
## 
## Number of Fisher Scoring iterations: 3

###Model 2g: Preference for RG ~ All dependent variables; Among Non-Congress Voters

logit.fit.2g <- glm(y0 ~ s_  + age + female + rural + level_of_education + caste_religion
                   + farmers + unemployed + casual_labour 
                   + asset_cat + secular + strongman + caste_census + bjp_constitution_change + inequality + inc_appeasement +                     modi_communal_caa + modi_unemployment_corrupt, family=binomial(link = "logit"))
summary(logit.fit.2g)
## 
## Call:
## glm(formula = y0 ~ s_ + age + female + rural + level_of_education + 
##     caste_religion + farmers + unemployed + casual_labour + asset_cat + 
##     secular + strongman + caste_census + bjp_constitution_change + 
##     inequality + inc_appeasement + modi_communal_caa + modi_unemployment_corrupt, 
##     family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.6258  -1.0646   0.5487   1.0163   2.2529  
## 
## Coefficients:
##                              Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                 -1.357301   0.133488 -10.168  < 2e-16 ***
## s_Andhra Pradesh             1.335272   0.086467  15.443  < 2e-16 ***
## s_Assam                      0.694387   0.118621   5.854 4.80e-09 ***
## s_Bihar                      0.295162   0.078387   3.765 0.000166 ***
## s_Chhattisgarh               0.812483   0.123871   6.559 5.41e-11 ***
## s_Delhi                      0.277691   0.150191   1.849 0.064470 .  
## s_Haryana                    0.445348   0.139967   3.182 0.001464 ** 
## s_Himachal Pradesh           0.625311   0.161263   3.878 0.000105 ***
## s_Jharkhand                 -0.427667   0.100121  -4.272 1.94e-05 ***
## s_Karnataka                 -0.419536   0.104067  -4.031 5.54e-05 ***
## s_Kerala                     0.859647   0.112479   7.643 2.13e-14 ***
## s_Madhya Pradesh             0.335519   0.088598   3.787 0.000152 ***
## s_Maharashtra                0.644658   0.079336   8.126 4.45e-16 ***
## s_Odisha                     0.773072   0.089853   8.604  < 2e-16 ***
## s_Punjab                    -0.041377   0.120743  -0.343 0.731835    
## s_Rajasthan                  0.087073   0.097048   0.897 0.369600    
## s_Tamil Nadu                 1.198020   0.084479  14.181  < 2e-16 ***
## s_Telangana                 -0.001132   0.102151  -0.011 0.991160    
## s_Uttar Pradesh              0.415545   0.073950   5.619 1.92e-08 ***
## s_West Bengal               -0.257416   0.081754  -3.149 0.001640 ** 
## age                         -0.000684   0.001086  -0.630 0.528729    
## female                       0.053696   0.029096   1.845 0.064969 .  
## rural                       -0.031059   0.034691  -0.895 0.370625    
## level_of_education          -0.027030   0.007537  -3.586 0.000336 ***
## caste_religionHindu and OBC -0.096006   0.071517  -1.342 0.179462    
## caste_religionHindu and SC   0.044936   0.076745   0.586 0.558197    
## caste_religionHindu and ST  -0.093753   0.085973  -1.090 0.275493    
## caste_religionHindu and UC  -0.294301   0.073063  -4.028 5.62e-05 ***
## caste_religionMuslim         1.266885   0.084754  14.948  < 2e-16 ***
## farmers                      0.085256   0.037606   2.267 0.023383 *  
## unemployed                   0.114284   0.062270   1.835 0.066460 .  
## casual_labour                0.079582   0.044842   1.775 0.075948 .  
## asset_cat                   -0.004845   0.018921  -0.256 0.797891    
## secular                      0.391615   0.033998  11.519  < 2e-16 ***
## strongman                   -0.242235   0.032058  -7.556 4.15e-14 ***
## caste_census                 0.427670   0.029192  14.650  < 2e-16 ***
## bjp_constitution_change      0.387002   0.029497  13.120  < 2e-16 ***
## inequality                   0.608308   0.031407  19.369  < 2e-16 ***
## inc_appeasement             -0.430955   0.029250 -14.734  < 2e-16 ***
## modi_communal_caa            0.162137   0.053662   3.021 0.002516 ** 
## modi_unemployment_corrupt    0.284088   0.038565   7.366 1.75e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 36860  on 26682  degrees of freedom
## Residual deviance: 32782  on 26642  degrees of freedom
## AIC: 32864
## 
## Number of Fisher Scoring iterations: 4

###Summary Table: Model 2

se_list <- list(rep(NA, length(coef(logit.fit.2a))), 
                rep(NA, length(coef(logit.fit.2b))), 
                rep(NA, length(coef(logit.fit.2c))), 
                rep(NA, length(coef(logit.fit.2d))), 
                rep(NA, length(coef(logit.fit.2e))), 
                rep(NA, length(coef(logit.fit.2f))),
                rep(NA, length(coef(logit.fit.2g))))

# Use stargazer and pass the cleaned names as the custom coefficient labels
summary_model2 <- stargazer(logit.fit.2a, logit.fit.2b, logit.fit.2c, logit.fit.2d, logit.fit.2e, logit.fit.2f, logit.fit.2g,
                             type = "text",          
                             title = "Characterising Potential Congress Voters",  # Table title
                             dep.var.caption = "Model 2: Preference for Rahul Gandhi among Non-Congress Voters",  # Caption for the dependent variable
                             p.auto = FALSE,           # Automatically print p-values
                             p.style = "asterisk",    # Style of p-value stars (* for coefficients only)
                             column.labels = c("2a", "2b", "2c", "2d", "2e", "2f", "2g"),
                             dep.var.labels = c("Logistic Regression Estimates/Coefficiants"), 
                             single.row = TRUE,       # Display statistics in a single row
                             digits = 2,              # Number of digits to display
                             se = se_list,
                             covariate.labels = predictor_labels
)
## 
## Characterising Potential Congress Voters
## ==========================================================================================================
##                                      Model 2: Preference for Rahul Gandhi among Non-Congress Voters       
##                               ----------------------------------------------------------------------------
##                                                Logistic Regression Estimates/Coefficiants                 
##                                   2a         2b         2c         2d         2e         2f         2g    
##                                  (1)        (2)        (3)        (4)        (5)        (6)        (7)    
## ----------------------------------------------------------------------------------------------------------
## Andhra Pradesh                 1.36***                                                           1.34***  
## Assam                          0.45***                                                           0.69***  
## Bihar                          0.37***                                                           0.30***  
## Chhattisgarh                   0.71***                                                           0.81***  
## Delhi                          0.46***                                                            0.28*   
## Haryana                         0.26*                                                            0.45***  
## Himachal Pradesh                 0.25                                                            0.63***  
## Jharkhand                      -0.26***                                                          -0.43*** 
## Karnataka                      -0.65***                                                          -0.42*** 
## Kerala                         0.98***                                                           0.86***  
## Madhya Pradesh                 0.27***                                                           0.34***  
## Maharashtra                    0.60***                                                           0.64***  
## Odisha                         0.83***                                                           0.77***  
## Punjab                          -0.10                                                             -0.04   
## Rajasthan                       -0.01                                                              0.09   
## Tamil Nadu                     1.13***                                                           1.20***  
## Telangana                        0.05                                                             -0.001  
## Uttar Pradesh                  0.48***                                                           0.42***  
## West Bengal                    -0.16**                                                           -0.26*** 
## Age                            -0.01***                                                           -0.001  
## Female                          -0.02                                                             0.05*   
## Rural                          -0.09***                                                           -0.03   
## Level of Education             -0.07***                                                          -0.03*** 
## Hindu OBC                                  -0.06                                                  -0.10   
## Hindu SC                                    0.06                                                   0.04   
## Hindu ST                                  -0.24***                                                -0.09   
## Hindu UC                                  -0.41***                                               -0.29*** 
## Muslims                                   1.09***                                                1.27***  
## Farmers                                               -0.03                                       0.09**  
## Unemployed                                             0.09                                       0.11*   
## Casual Labour                                        0.23***                                      0.08*   
## Asset Category                                                   -0.004                           -0.005  
## Secular                                                                    0.55***               0.39***  
## Strongman Politics                                                         -0.17***              -0.24*** 
## Support for Caste Census                                                   0.35***               0.43***  
## BJP Constitution Change                                                    0.42***               0.39***  
## High Inequality                                                            0.74***               0.61***  
## Congress Appeasement Politics                                              -0.50***              -0.43*** 
## Modi and Communal Politics                                                            0.28***    0.16***  
## Modi and Unemployment                                                                 0.28***    0.28***  
## Constant                       0.26***    0.17***    0.11***    0.15***    -0.97***   -0.09***   -1.36*** 
## ----------------------------------------------------------------------------------------------------------
## Observations                    26,683     26,683     26,683     26,683     26,683     26,683     26,683  
## Log Likelihood                -17,684.97 -17,927.84 -18,408.47 -18,430.11 -17,465.47 -18,396.00 -16,391.07
## Akaike Inf. Crit.             35,417.94  35,867.69  36,824.95  36,864.23  34,944.94  36,798.00  32,864.15 
## ==========================================================================================================
## Note:                                                                          *p<0.1; **p<0.05; ***p<0.01
## 
## Characterising Potential Congress Voters
## ========
## asterisk
## --------

##Model 3: Preference for RG among non-india voters

###Defining Dependent & Independent Variables (Among Non-India Voters)

###Summary Stats: Among Non-India Voters

##Summary Stats on dependent variables
SummaryStats_DependentVariables <- non_india %>% 
  dplyr::select(pl20, bi1, bi11, bi13, revised_religion, dh3, dh5, asset_count, revised_assetcat, voter_cat1, voter_cat2, pov5, c7, pl34, pl35, pl1, caste_rel, marg_prom) %>% 
  rename("Pref for RG" = pl20,
         "State" = bi1,
         "Presence of Congress" = marg_prom,
         "Urban/Rural" = bi11,
         "Gender" = bi13,
         "Primary Activity" = dh3,
         "Official Caste" = dh5,
         "Voting Pref (LS 24)" = voter_cat1,
         "Voting Pref and like RG (LS24)" = voter_cat2,
         "Caste Census" = pov5,
         "Secular/Hindu" = c7,
         "Leadership" = pl35,
         "Pref for Modi" = pl1,
         "Asset Cateogry (1-4)" = revised_assetcat,
         "Failures of the BJP" = pl34) %>% 
  mutate(Leadership = ifelse(Leadership == "A democracy in which a strong leader can make decisions without interference from the parliament or the courts.", "Strongman", "Consensus Building"))

SummaryStats_DependentVariables$asset_count <- as.factor(SummaryStats_DependentVariables$asset_count)

summary_output <- dfSummary(SummaryStats_DependentVariables, 
                            varnumbers = TRUE, 
                            valid.col = FALSE, 
                            title = "Summary Statistics: Dependent Variables (Among Non-India Voters)")

# Render the summary output
print(summary_output, file = "dfSummary_DepVariables.html")
includeHTML("dfSummary_DepVariables.html")
Data Frame Summary

Data Frame Summary

SummaryStats_DependentVariables

Dimensions: 20260 x 18
Duplicates: 3068
No Variable Stats / Values Freqs (% of Valid) Graph Missing
1 Pref for RG [character]
1. No
2. Yes
10662(52.6%)
9598(47.4%)
0 (0.0%)
2 State [factor]
1. Gujarat
2. Andhra Pradesh
3. Assam
4. Bihar
5. Chhattisgarh
6. Delhi
7. Haryana
8. Himachal Pradesh
9. Jharkhand
10. Karnataka
[ 10 others ]
999(4.9%)
1981(9.8%)
492(2.4%)
1692(8.4%)
432(2.1%)
125(0.6%)
244(1.2%)
215(1.1%)
661(3.3%)
854(4.2%)
12565(62.0%)
0 (0.0%)
3 Urban/Rural [character]
1. Rural
2. Urban
15352(75.8%)
4908(24.2%)
0 (0.0%)
4 Gender [character]
1. Female
2. Male
3. Others
9260(45.7%)
10997(54.3%)
3(0.0%)
0 (0.0%)
5 revised_religion [character]
1. Hinduism
2. Islam
3. Other Minorities
4. Refused to Mention
18135(89.5%)
1155(5.7%)
923(4.6%)
47(0.2%)
0 (0.0%)
6 Primary Activity [character]
1. Aged/Retired
2. Daily wage labourer/Casua
3. Farmer
4. Government Job
5. Housewife
6. Others
7. Private job (Regular sala
8. Self-Employed/Business
9. Student
10. Unemployed/Looking for jo
1055(5.2%)
2457(12.1%)
4431(21.9%)
611(3.0%)
4810(23.7%)
317(1.6%)
2302(11.4%)
1870(9.2%)
1284(6.3%)
1123(5.5%)
0 (0.0%)
7 Official Caste [character]
1. General
2. Other Backward Class (OBC
3. Scheduled Caste (SC)/Dali
4. Scheduled Tribe (ST)/Adiv
6059(29.9%)
9087(44.9%)
3427(16.9%)
1687(8.3%)
0 (0.0%)
8 asset_count [factor]
1. 0
2. 1
3. 2
4. 3
5. 4
6. 5
7. 6
8. 7
9. 8
10. 9
[ 3 others ]
1003(5.0%)
3308(16.3%)
4869(24.0%)
4866(24.0%)
2723(13.4%)
1480(7.3%)
892(4.4%)
506(2.5%)
322(1.6%)
230(1.1%)
61(0.3%)
0 (0.0%)
9 Asset Cateogry (1-4) [numeric]
Mean (sd) : 1.7 (0.8)
min ≤ med ≤ max:
1 ≤ 2 ≤ 4
IQR (CV) : 1 (0.5)
1:9180(45.3%)
2:7589(37.5%)
3:2878(14.2%)
4:613(3.0%)
0 (0.0%)
10 Voting Pref (LS 24) [factor]
1. Voted for the Congress
2. Voted for INDIA but not C
3. Voted for the BJP
4. Voted for the NDA but not
5. Voted for the Third Front
6. Voted for Independent Can
7. Don't want to specify
0(0.0%)
0(0.0%)
11224(55.4%)
2401(11.9%)
3156(15.6%)
473(2.3%)
3006(14.8%)
0 (0.0%)
11 Voting Pref and like RG (LS24) [factor]
1. Voted for the Congress an
2. Voted for the Congress an
3. Voted for INDIA and like
4. Voted for INDIA and does
5. Voted for the BJP and lik
6. Voted for the BJP and doe
7. Voted for the NDA and lik
8. Voted for the NDA and doe
9. Voted for the Third Front
10. Voted for the Third Front
0(0.0%)
0(0.0%)
0(0.0%)
0(0.0%)
4247(21.0%)
6977(34.4%)
1239(6.1%)
1162(5.7%)
4112(20.3%)
2523(12.5%)
0 (0.0%)
12 Caste Census [character]
1. Can't Say
2. No
3. Yes
3814(18.8%)
3780(18.7%)
12666(62.5%)
0 (0.0%)
13 Secular/Hindu [character]
1. India is a Hindu country
2. India is a Secular countr
4490(22.2%)
15770(77.8%)
0 (0.0%)
14 Failures of the BJP [character]
1. CAA
2. Communalisation and Hurti
3. Hurt Global Reputation
4. Increased Corruption
5. Increased Unemployment
2798(13.8%)
2252(11.1%)
555(2.7%)
2498(12.3%)
12157(60.0%)
0 (0.0%)
15 Leadership [character]
1. Consensus Building
2. Strongman
15648(77.2%)
4612(22.8%)
0 (0.0%)
16 Pref for Modi [character]
1. No
2. Yes
3186(15.7%)
17074(84.3%)
0 (0.0%)
17 caste_rel [factor]
1. Others/Refused to Mention
2. Hindu and OBC
3. Hindu and SC
4. Hindu and ST
5. Hindu and UC
6. Muslim
970(4.8%)
8237(40.7%)
3036(15.0%)
1566(7.7%)
5296(26.1%)
1155(5.7%)
0 (0.0%)
18 Presence of Congress [character]
1. Marginal
2. Prominent
11376(56.2%)
8884(43.8%)
0 (0.0%)

Generated by summarytools 1.0.0 (R version 4.0.3)
2024-10-15

###Cross-tabs: Preference for RG and dependent Variables (Among Non-India Voters)

caste_pl20 <- round(100*prop.table(table(non_india$pl20, "Caste Categories" = non_india$dh5), 2),2)
religion_pl20 <- round(100*prop.table(table(non_india$pl20, "Religion" = non_india$revised_religion), 2),2)
nu_pl20 <- round(100*prop.table(table(non_india$pl20, "Nature of Locality" = non_india$bi11), 2),2)
gender_pl20 <- round(100*prop.table(table(non_india$pl20, "Gender" = non_india$bi13), 2),2)
asset_pl20 <- round(100*prop.table(table(non_india$pl20, "Assent Ranks" = non_india$revised_assetcat), 2),2)
primact_pl20 <- round(100*prop.table(table(non_india$pl20, "Primary Activity" = non_india$dh3), 2),2)
secular_pl20 <- round(100*prop.table(table(non_india$pl20, "Secular/Hindu Country" = non_india$c7), 2),2)
castecensus_pl20 <- round(100*prop.table(table(non_india$pl20, "Opinion on Caste Census" = non_india$pov5), 2),2)
leadership_pl20 <- round(100*prop.table(table(non_india$pl20, "Nature of Political Leadership" = non_india$pl35), 2),2)

print(caste_pl20)
##      Caste Categories
##       General Other Backward Class (OBC) Scheduled Caste (SC)/Dalit
##   No    56.68                      51.49                      48.70
##   Yes   43.32                      48.51                      51.30
##      Caste Categories
##       Scheduled Tribe (ST)/Adivasi
##   No                         52.16
##   Yes                        47.84
print(religion_pl20)
##      Religion
##       Hinduism Islam Other Minorities Refused to Mention
##   No     54.45 28.57            46.59              59.57
##   Yes    45.55 71.43            53.41              40.43
print(nu_pl20)
##      Nature of Locality
##       Rural Urban
##   No  52.23 53.85
##   Yes 47.77 46.15
print(gender_pl20)
##      Gender
##       Female  Male Others
##   No   51.45 53.62  33.33
##   Yes  48.55 46.38  66.67
print(asset_pl20)
##      Assent Ranks
##           1     2     3     4
##   No  52.39 53.89 50.03 52.69
##   Yes 47.61 46.11 49.97 47.31
print(primact_pl20)
##      Primary Activity
##       Aged/Retired Daily wage labourer/Casual Labour Farmer Government Job
##   No         48.44                             48.96  53.40          53.52
##   Yes        51.56                             51.04  46.60          46.48
##      Primary Activity
##       Housewife Others Private job (Regular salaried) Self-Employed/Business
##   No      54.24  58.68                          52.00                  54.28
##   Yes     45.76  41.32                          48.00                  45.72
##      Primary Activity
##       Student Unemployed/Looking for jobs
##   No    53.43                       50.04
##   Yes   46.57                       49.96
print(secular_pl20)
##      Secular/Hindu Country
##       India is a Hindu country
##   No                     64.05
##   Yes                    35.95
##      Secular/Hindu Country
##       India is a Secular country where all religions are considered equal
##   No                                                                49.37
##   Yes                                                               50.63
print(castecensus_pl20)
##      Opinion on Caste Census
##       Can't Say    No   Yes
##   No      59.20 58.20 48.98
##   Yes     40.80 41.80 51.02
print(leadership_pl20)
##      Nature of Political Leadership
##       A democracy in which a strong leader can make decisions without interference from the parliament or the courts.
##   No                                                                                                            57.85
##   Yes                                                                                                           42.15
##      Nature of Political Leadership
##       A democracy in which elected representatives decide what becomes law.
##   No                                                                  51.09
##   Yes                                                                 48.91

###Model 3a: Preference for RG and Age, Gender (Dummy) and Nature of Locality (Dummy); Among Non-India Voters

logit.fit.3a <- glm(y0 ~ s_ + age + female + rural + level_of_education, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.3a)
## 
## Call:
## glm(formula = y0 ~ s_ + age + female + rural + level_of_education, 
##     family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7415  -1.0584  -0.7874   1.1535   1.7242  
## 
## Coefficients:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)         0.013060   0.099895   0.131 0.895985    
## s_Andhra Pradesh    1.335816   0.082271  16.237  < 2e-16 ***
## s_Assam             0.423303   0.111188   3.807 0.000141 ***
## s_Bihar            -0.432993   0.082451  -5.252 1.51e-07 ***
## s_Chhattisgarh      0.710830   0.117749   6.037 1.57e-09 ***
## s_Delhi            -0.217963   0.197292  -1.105 0.269258    
## s_Haryana           0.032561   0.144504   0.225 0.821725    
## s_Himachal Pradesh  0.193078   0.152031   1.270 0.204087    
## s_Jharkhand        -0.701545   0.107907  -6.501 7.96e-11 ***
## s_Karnataka        -0.652042   0.099263  -6.569 5.07e-11 ***
## s_Kerala            0.974880   0.115100   8.470  < 2e-16 ***
## s_Madhya Pradesh    0.282086   0.084555   3.336 0.000850 ***
## s_Maharashtra       0.396965   0.078843   5.035 4.78e-07 ***
## s_Odisha            0.850619   0.087582   9.712  < 2e-16 ***
## s_Punjab           -0.204822   0.130027  -1.575 0.115204    
## s_Rajasthan        -0.163929   0.096408  -1.700 0.089064 .  
## s_Tamil Nadu        0.425524   0.088163   4.827 1.39e-06 ***
## s_Telangana         0.032706   0.097964   0.334 0.738488    
## s_Uttar Pradesh    -0.040500   0.073047  -0.554 0.579281    
## s_West Bengal      -0.680293   0.091436  -7.440 1.01e-13 ***
## age                -0.002866   0.001169  -2.452 0.014225 *  
## female              0.012558   0.029884   0.420 0.674312    
## rural              -0.002978   0.036481  -0.082 0.934946    
## level_of_education -0.047778   0.007530  -6.345 2.23e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 28030  on 20259  degrees of freedom
## Residual deviance: 26464  on 20236  degrees of freedom
## AIC: 26512
## 
## Number of Fisher Scoring iterations: 4

###Model 3b: Preference for RG ~ Religion (Ref == Hinduism), Caste (Ref == General); Among Non-India Voters

logit.fit.3b <- glm(y0 ~ caste_religion, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.3b)
## 
## Call:
## glm(formula = y0 ~ caste_religion, family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.583  -1.113  -1.029   1.243   1.333  
## 
## Coefficients:
##                             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                  0.11146    0.06432   1.733   0.0831 .  
## caste_religionHindu and OBC -0.26546    0.06801  -3.903 9.49e-05 ***
## caste_religionHindu and SC  -0.08247    0.07385  -1.117   0.2641    
## caste_religionHindu and ST  -0.21884    0.08184  -2.674   0.0075 ** 
## caste_religionHindu and UC  -0.47024    0.07012  -6.707 1.99e-11 ***
## caste_religionMuslim         0.80484    0.09154   8.792  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 28030  on 20259  degrees of freedom
## Residual deviance: 27643  on 20254  degrees of freedom
## AIC: 27655
## 
## Number of Fisher Scoring iterations: 4

###Model 3c: Preference for RG ~ Primary Acitivty Dummies: Farmers, Casual Labourers, Unemployed (Among Non-India Voters)

logit.fit.3c <- glm(y0 ~ farmers + unemployed + casual_labour, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.3c)
## 
## Call:
## glm(formula = y0 ~ farmers + unemployed + casual_labour, family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.195  -1.121  -1.120   1.234   1.236  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)   -0.13294    0.01811  -7.340 2.13e-13 ***
## farmers       -0.00313    0.03514  -0.089   0.9290    
## unemployed     0.13116    0.06237   2.103   0.0355 *  
## casual_labour  0.17446    0.04423   3.944 8.01e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 28030  on 20259  degrees of freedom
## Residual deviance: 28011  on 20256  degrees of freedom
## AIC: 28019
## 
## Number of Fisher Scoring iterations: 3

###Model 3d: Preference for RG ~ Assent Rank (Numeric Range; c(1,5)), Ownership of AC (dummy), Ownership of Car (dummy); Among Non-India Voters

logit.fit.3d <- glm(y0 ~ asset_cat, family=binomial(link = "logit"))
# Summary of the model
summary(logit.fit.3d)
## 
## Call:
## glm(formula = y0 ~ asset_cat, family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.148  -1.135  -1.128   1.221   1.227  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -0.13254    0.03355  -3.951 7.79e-05 ***
## asset_cat    0.01566    0.01740   0.900    0.368    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 28030  on 20259  degrees of freedom
## Residual deviance: 28030  on 20258  degrees of freedom
## AIC: 28034
## 
## Number of Fisher Scoring iterations: 3

###Model 3e: Preference for RG ~ Political Positions: Secular/Hindu Country (dummy), Leadership (dummy), Caste Census (dummy), Likes Modi (dummy); Among Non-India Voters

logit.fit.3e <- glm(y0 ~ secular + strongman + caste_census + bjp_constitution_change + inequality + inc_appeasement, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.3e)
## 
## Call:
## glm(formula = y0 ~ secular + strongman + caste_census + bjp_constitution_change + 
##     inequality + inc_appeasement, family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5302  -1.1131  -0.7021   1.1076   1.9883  
## 
## Coefficients:
##                         Estimate Std. Error z value Pr(>|z|)    
## (Intercept)             -1.16003    0.04551 -25.492  < 2e-16 ***
## secular                  0.55413    0.03612  15.342  < 2e-16 ***
## strongman               -0.18024    0.03535  -5.099 3.42e-07 ***
## caste_census             0.26030    0.03113   8.361  < 2e-16 ***
## bjp_constitution_change  0.37275    0.03218  11.585  < 2e-16 ***
## inequality               0.77229    0.03427  22.534  < 2e-16 ***
## inc_appeasement         -0.48738    0.03192 -15.267  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 28030  on 20259  degrees of freedom
## Residual deviance: 26674  on 20253  degrees of freedom
## AIC: 26688
## 
## Number of Fisher Scoring iterations: 4

###Model 3f: Preference for RG ~ Biggest Failure of BJP: Communalisation, Unemoployment (dummies); Among Non-India Voters

logit.fit.3f <- glm(y0 ~ modi_communal_caa + modi_unemployment_corrupt, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.3f)
## 
## Call:
## glm(formula = y0 ~ modi_communal_caa + modi_unemployment_corrupt, 
##     family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.171  -1.142  -1.070   1.214   1.288  
## 
## Coefficients:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)               -0.25730    0.03483  -7.388 1.49e-13 ***
## modi_communal_caa          0.24309    0.05467   4.446 8.74e-06 ***
## modi_unemployment_corrupt  0.17277    0.03855   4.482 7.41e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 28030  on 20259  degrees of freedom
## Residual deviance: 28005  on 20257  degrees of freedom
## AIC: 28011
## 
## Number of Fisher Scoring iterations: 3

###Model 3g: Preference for RG ~ All dependent variables; Among Non-India Voters

logit.fit.3g <- glm(y0 ~ s_  + age + female + rural + level_of_education + caste_religion
                   + farmers + unemployed + casual_labour 
                   + asset_cat + secular + strongman + caste_census + bjp_constitution_change + inequality + inc_appeasement +                     modi_communal_caa + modi_unemployment_corrupt, family=binomial(link = "logit"))
summary(logit.fit.3g)
## 
## Call:
## glm(formula = y0 ~ s_ + age + female + rural + level_of_education + 
##     caste_religion + farmers + unemployed + casual_labour + asset_cat + 
##     secular + strongman + caste_census + bjp_constitution_change + 
##     inequality + inc_appeasement + modi_communal_caa + modi_unemployment_corrupt, 
##     family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.4580  -1.0239  -0.5919   1.0750   2.2876  
## 
## Coefficients:
##                               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                 -1.2932118  0.1464527  -8.830  < 2e-16 ***
## s_Andhra Pradesh             1.3055178  0.0867407  15.051  < 2e-16 ***
## s_Assam                      0.6787274  0.1205006   5.633 1.78e-08 ***
## s_Bihar                     -0.3550031  0.0855531  -4.150 3.33e-05 ***
## s_Chhattisgarh               0.8183447  0.1238235   6.609 3.87e-11 ***
## s_Delhi                     -0.3018740  0.2054699  -1.469 0.141782    
## s_Haryana                    0.2095268  0.1500087   1.397 0.162484    
## s_Himachal Pradesh           0.5430598  0.1608950   3.375 0.000738 ***
## s_Jharkhand                 -0.7460304  0.1114950  -6.691 2.21e-11 ***
## s_Karnataka                 -0.4296802  0.1040195  -4.131 3.62e-05 ***
## s_Kerala                     0.8818643  0.1242955   7.095 1.29e-12 ***
## s_Madhya Pradesh             0.3419508  0.0886764   3.856 0.000115 ***
## s_Maharashtra                0.4848324  0.0825907   5.870 4.35e-09 ***
## s_Odisha                     0.7733167  0.0905675   8.539  < 2e-16 ***
## s_Punjab                    -0.1366395  0.1452836  -0.941 0.346960    
## s_Rajasthan                 -0.0957207  0.1001874  -0.955 0.339367    
## s_Tamil Nadu                 0.5077186  0.0933591   5.438 5.38e-08 ***
## s_Telangana                 -0.0097878  0.1023459  -0.096 0.923811    
## s_Uttar Pradesh              0.0253699  0.0764067   0.332 0.739861    
## s_West Bengal               -0.5263327  0.0964666  -5.456 4.87e-08 ***
## age                         -0.0002894  0.0012346  -0.234 0.814659    
## female                       0.0659181  0.0329838   1.998 0.045663 *  
## rural                        0.0014547  0.0398515   0.037 0.970882    
## level_of_education          -0.0226599  0.0085060  -2.664 0.007722 ** 
## caste_religionHindu and OBC -0.1182250  0.0801232  -1.476 0.140068    
## caste_religionHindu and SC   0.0702631  0.0864646   0.813 0.416434    
## caste_religionHindu and ST  -0.1302575  0.0950314  -1.371 0.170475    
## caste_religionHindu and UC  -0.2437549  0.0818538  -2.978 0.002902 ** 
## caste_religionMuslim         0.8915227  0.1039081   8.580  < 2e-16 ***
## farmers                      0.0967648  0.0426712   2.268 0.023348 *  
## unemployed                   0.1412030  0.0693177   2.037 0.041646 *  
## casual_labour                0.0889336  0.0518684   1.715 0.086418 .  
## asset_cat                   -0.0044568  0.0213041  -0.209 0.834294    
## secular                      0.3681399  0.0386214   9.532  < 2e-16 ***
## strongman                   -0.2495921  0.0375862  -6.641 3.13e-11 ***
## caste_census                 0.3541623  0.0334524  10.587  < 2e-16 ***
## bjp_constitution_change      0.3453926  0.0339783  10.165  < 2e-16 ***
## inequality                   0.6266754  0.0362194  17.302  < 2e-16 ***
## inc_appeasement             -0.4202579  0.0336481 -12.490  < 2e-16 ***
## modi_communal_caa            0.1460452  0.0612312   2.385 0.017072 *  
## modi_unemployment_corrupt    0.2319250  0.0437214   5.305 1.13e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 28030  on 20259  degrees of freedom
## Residual deviance: 25147  on 20219  degrees of freedom
## AIC: 25229
## 
## Number of Fisher Scoring iterations: 4

###Summary Table: Model 3

se_list <- list(rep(NA, length(coef(logit.fit.3a))), 
                rep(NA, length(coef(logit.fit.3b))), 
                rep(NA, length(coef(logit.fit.3c))), 
                rep(NA, length(coef(logit.fit.3d))), 
                rep(NA, length(coef(logit.fit.3e))), 
                rep(NA, length(coef(logit.fit.3f))),
                rep(NA, length(coef(logit.fit.3g))))

# Use stargazer and pass the cleaned names as the custom coefficient labels
summary_model3 <- stargazer(logit.fit.3a, logit.fit.3b, logit.fit.3c, logit.fit.3d, logit.fit.3e, logit.fit.3f, logit.fit.3g,
                             type = "text",          
                             title = "Characterising Potential Congress Voters",  # Table title
                             dep.var.caption = "Model 3: Preference for Rahul Gandhi among Non-India Voters",  # Caption for the dependent variable
                             p.auto = FALSE,           # Automatically print p-values
                             p.style = "asterisk",    # Style of p-value stars (* for coefficients only)
                             column.labels = c("3a", "3b", "3c", "3d", "3e", "3f", "3g"),
                             dep.var.labels = c("Logistic Regression Estimates/Coefficiants"), 
                             single.row = TRUE,       # Display statistics in a single row
                             digits = 2,              # Number of digits to display
                             se = se_list,
                             covariate.labels = predictor_labels
)
## 
## Characterising Potential Congress Voters
## ==========================================================================================================
##                                       Model 3: Preference for Rahul Gandhi among Non-India Voters         
##                               ----------------------------------------------------------------------------
##                                                Logistic Regression Estimates/Coefficiants                 
##                                   3a         3b         3c         3d         3e         3f         3g    
##                                  (1)        (2)        (3)        (4)        (5)        (6)        (7)    
## ----------------------------------------------------------------------------------------------------------
## Andhra Pradesh                 1.34***                                                           1.31***  
## Assam                          0.42***                                                           0.68***  
## Bihar                          -0.43***                                                          -0.36*** 
## Chhattisgarh                   0.71***                                                           0.82***  
## Delhi                           -0.22                                                             -0.30   
## Haryana                          0.03                                                              0.21   
## Himachal Pradesh                 0.19                                                            0.54***  
## Jharkhand                      -0.70***                                                          -0.75*** 
## Karnataka                      -0.65***                                                          -0.43*** 
## Kerala                         0.97***                                                           0.88***  
## Madhya Pradesh                 0.28***                                                           0.34***  
## Maharashtra                    0.40***                                                           0.48***  
## Odisha                         0.85***                                                           0.77***  
## Punjab                          -0.20                                                             -0.14   
## Rajasthan                       -0.16*                                                            -0.10   
## Tamil Nadu                     0.43***                                                           0.51***  
## Telangana                        0.03                                                             -0.01   
## Uttar Pradesh                   -0.04                                                              0.03   
## West Bengal                    -0.68***                                                          -0.53*** 
## Age                            -0.003**                                                          -0.0003  
## Female                           0.01                                                             0.07**  
## Rural                           -0.003                                                            0.001   
## Level of Education             -0.05***                                                          -0.02*** 
## Hindu OBC                                 -0.27***                                                -0.12   
## Hindu SC                                   -0.08                                                   0.07   
## Hindu ST                                  -0.22***                                                -0.13   
## Hindu UC                                  -0.47***                                               -0.24*** 
## Muslims                                   0.80***                                                0.89***  
## Farmers                                               -0.003                                      0.10**  
## Unemployed                                            0.13**                                      0.14**  
## Casual Labour                                        0.17***                                      0.09*   
## Asset Category                                                    0.02                            -0.004  
## Secular                                                                    0.55***               0.37***  
## Strongman Politics                                                         -0.18***              -0.25*** 
## Support for Caste Census                                                   0.26***               0.35***  
## BJP Constitution Change                                                    0.37***               0.35***  
## High Inequality                                                            0.77***               0.63***  
## Congress Appeasement Politics                                              -0.49***              -0.42*** 
## Modi and Communal Politics                                                            0.24***     0.15**  
## Modi and Unemployment                                                                 0.17***    0.23***  
## Constant                         0.01      0.11*     -0.13***   -0.13***   -1.16***   -0.26***   -1.29*** 
## ----------------------------------------------------------------------------------------------------------
## Observations                    20,260     20,260     20,260     20,260     20,260     20,260     20,260  
## Log Likelihood                -13,231.78 -13,821.29 -14,005.40 -14,014.80 -13,337.03 -14,002.51 -12,573.58
## Akaike Inf. Crit.             26,511.57  27,654.58  28,018.80  28,033.61  26,688.05  28,011.02  25,229.17 
## ==========================================================================================================
## Note:                                                                          *p<0.1; **p<0.05; ***p<0.01
## 
## Characterising Potential Congress Voters
## ========
## asterisk
## --------

##Model 4: Preference for RG among NDA voters

###Defining Dependent & Independent Variables (Among NDA Voters)

###Summary Stats: Among NDA Voters

##Summary Stats on dependent variables
SummaryStats_DependentVariables <- nda %>% 
  dplyr::select(pl20, bi1, bi11, bi13, revised_religion, dh3, dh5, asset_count, revised_assetcat, voter_cat1, voter_cat2, pov5, c7, pl34, pl35, pl1, caste_rel, marg_prom) %>% 
  rename("Pref for RG" = pl20,
         "State" = bi1,
        "Presence of Congress" = marg_prom,
         "Urban/Rural" = bi11,
         "Gender" = bi13,
         "Primary Activity" = dh3,
         "Official Caste" = dh5,
         "Voting Pref (LS 24)" = voter_cat1,
         "Voting Pref and like RG (LS24)" = voter_cat2,
         "Caste Census" = pov5,
         "Secular/Hindu" = c7,
         "Leadership" = pl35,
         "Pref for Modi" = pl1,
         "Asset Cateogry (1-4)" = revised_assetcat,
         "Failures of the BJP" = pl34) %>% 
  mutate(Leadership = ifelse(Leadership == "A democracy in which a strong leader can make decisions without interference from the parliament or the courts.", "Strongman", "Consensus Building"))

SummaryStats_DependentVariables$asset_count <- as.factor(SummaryStats_DependentVariables$asset_count)

summary_output <- dfSummary(SummaryStats_DependentVariables, 
                            varnumbers = TRUE, 
                            valid.col = FALSE, 
                            title = "Summary Statistics: Dependent Variables (Among NDA Voters)")

# Render the summary output
print(summary_output, file = "dfSummary_DepVariables.html")
includeHTML("dfSummary_DepVariables.html")
Data Frame Summary

Data Frame Summary

SummaryStats_DependentVariables

Dimensions: 13625 x 18
Duplicates: 2557
No Variable Stats / Values Freqs (% of Valid) Graph Missing
1 Pref for RG [character]
1. No
2. Yes
8139(59.7%)
5486(40.3%)
0 (0.0%)
2 State [factor]
1. Gujarat
2. Andhra Pradesh
3. Assam
4. Bihar
5. Chhattisgarh
6. Delhi
7. Haryana
8. Himachal Pradesh
9. Jharkhand
10. Karnataka
[ 10 others ]
773(5.7%)
1015(7.4%)
187(1.4%)
1562(11.5%)
344(2.5%)
88(0.6%)
215(1.6%)
113(0.8%)
610(4.5%)
550(4.0%)
8168(59.9%)
0 (0.0%)
3 Urban/Rural [character]
1. Rural
2. Urban
10442(76.6%)
3183(23.4%)
0 (0.0%)
4 Gender [character]
1. Female
2. Male
3. Others
6035(44.3%)
7588(55.7%)
2(0.0%)
0 (0.0%)
5 revised_religion [character]
1. Hinduism
2. Islam
3. Other Minorities
4. Refused to Mention
12852(94.3%)
397(2.9%)
350(2.6%)
26(0.2%)
0 (0.0%)
6 Primary Activity [character]
1. Aged/Retired
2. Daily wage labourer/Casua
3. Farmer
4. Government Job
5. Housewife
6. Others
7. Private job (Regular sala
8. Self-Employed/Business
9. Student
10. Unemployed/Looking for jo
625(4.6%)
1528(11.2%)
3249(23.8%)
413(3.0%)
3259(23.9%)
183(1.3%)
1497(11.0%)
1272(9.3%)
874(6.4%)
725(5.3%)
0 (0.0%)
7 Official Caste [character]
1. General
2. Other Backward Class (OBC
3. Scheduled Caste (SC)/Dali
4. Scheduled Tribe (ST)/Adiv
4277(31.4%)
6369(46.7%)
1895(13.9%)
1084(8.0%)
0 (0.0%)
8 asset_count [factor]
1. 0
2. 1
3. 2
4. 3
5. 4
6. 5
7. 6
8. 7
9. 8
10. 9
[ 3 others ]
620(4.6%)
2099(15.4%)
3219(23.6%)
3407(25.0%)
1852(13.6%)
1032(7.6%)
620(4.6%)
368(2.7%)
215(1.6%)
160(1.2%)
33(0.2%)
0 (0.0%)
9 Asset Cateogry (1-4) [numeric]
Mean (sd) : 1.8 (0.8)
min ≤ med ≤ max:
1 ≤ 2 ≤ 4
IQR (CV) : 1 (0.5)
1:5938(43.6%)
2:5259(38.6%)
3:2020(14.8%)
4:408(3.0%)
0 (0.0%)
10 Voting Pref (LS 24) [factor]
1. Voted for the Congress
2. Voted for INDIA but not C
3. Voted for the BJP
4. Voted for the NDA but not
5. Voted for the Third Front
6. Voted for Independent Can
7. Don't want to specify
0(0.0%)
0(0.0%)
11224(82.4%)
2401(17.6%)
0(0.0%)
0(0.0%)
0(0.0%)
0 (0.0%)
11 Voting Pref and like RG (LS24) [factor]
1. Voted for the Congress an
2. Voted for the Congress an
3. Voted for INDIA and like
4. Voted for INDIA and does
5. Voted for the BJP and lik
6. Voted for the BJP and doe
7. Voted for the NDA and lik
8. Voted for the NDA and doe
9. Voted for the Third Front
10. Voted for the Third Front
0(0.0%)
0(0.0%)
0(0.0%)
0(0.0%)
4247(31.2%)
6977(51.2%)
1239(9.1%)
1162(8.5%)
0(0.0%)
0(0.0%)
0 (0.0%)
12 Caste Census [character]
1. Can't Say
2. No
3. Yes
2197(16.1%)
2429(17.8%)
8999(66.0%)
0 (0.0%)
13 Secular/Hindu [character]
1. India is a Hindu country
2. India is a Secular countr
3545(26.0%)
10080(74.0%)
0 (0.0%)
14 Failures of the BJP [character]
1. CAA
2. Communalisation and Hurti
3. Hurt Global Reputation
4. Increased Corruption
5. Increased Unemployment
1752(12.9%)
1258(9.2%)
350(2.6%)
1485(10.9%)
8780(64.4%)
0 (0.0%)
15 Leadership [character]
1. Consensus Building
2. Strongman
10628(78.0%)
2997(22.0%)
0 (0.0%)
16 Pref for Modi [character]
1. No
2. Yes
837(6.1%)
12788(93.9%)
0 (0.0%)
17 caste_rel [factor]
1. Others/Refused to Mention
2. Hindu and OBC
3. Hindu and SC
4. Hindu and ST
5. Hindu and UC
6. Muslim
376(2.8%)
6097(44.7%)
1765(13.0%)
1022(7.5%)
3968(29.1%)
397(2.9%)
0 (0.0%)
18 Presence of Congress [character]
1. Marginal
2. Prominent
7663(56.2%)
5962(43.8%)
0 (0.0%)

Generated by summarytools 1.0.0 (R version 4.0.3)
2024-10-15

###Cross-tabs: Preference for RG and dependent Variables (Among NDA Voters)

caste_pl20 <- round(100*prop.table(table(nda$pl20, "Caste Categories" = nda$dh5), 2),2)
religion_pl20 <- round(100*prop.table(table(nda$pl20, "Religion" = nda$revised_religion), 2),2)
nu_pl20 <- round(100*prop.table(table(nda$pl20, "Nature of Locality" = nda$bi11), 2),2)
gender_pl20 <- round(100*prop.table(table(nda$pl20, "Gender" = nda$bi13), 2),2)
asset_pl20 <- round(100*prop.table(table(nda$pl20, "Assent Ranks" = nda$revised_assetcat), 2),2)
primact_pl20 <- round(100*prop.table(table(nda$pl20, "Primary Activity" = nda$dh3), 2),2)
secular_pl20 <- round(100*prop.table(table(nda$pl20, "Secular/Hindu Country" = nda$c7), 2),2)
castecensus_pl20 <- round(100*prop.table(table(nda$pl20, "Opinion on Caste Census" = nda$pov5), 2),2)
leadership_pl20 <- round(100*prop.table(table(nda$pl20, "Nature of Political Leadership" = nda$pl35), 2),2)

print(caste_pl20)
##      Caste Categories
##       General Other Backward Class (OBC) Scheduled Caste (SC)/Dalit
##   No    62.87                      58.28                      58.68
##   Yes   37.13                      41.72                      41.32
##      Caste Categories
##       Scheduled Tribe (ST)/Adivasi
##   No                         57.75
##   Yes                        42.25
print(religion_pl20)
##      Religion
##       Hinduism Islam Other Minorities Refused to Mention
##   No     60.05 48.11            59.71              84.62
##   Yes    39.95 51.89            40.29              15.38
print(nu_pl20)
##      Nature of Locality
##       Rural Urban
##   No  59.25 61.33
##   Yes 40.75 38.67
print(gender_pl20)
##      Gender
##       Female  Male Others
##   No   58.77 60.50  50.00
##   Yes  41.23 39.50  50.00
print(asset_pl20)
##      Assent Ranks
##           1     2     3     4
##   No  59.33 61.61 55.99 60.05
##   Yes 40.67 38.39 44.01 39.95
print(primact_pl20)
##      Primary Activity
##       Aged/Retired Daily wage labourer/Casual Labour Farmer Government Job
##   No         58.08                             58.18  58.08          58.60
##   Yes        41.92                             41.82  41.92          41.40
##      Primary Activity
##       Housewife Others Private job (Regular salaried) Self-Employed/Business
##   No      62.04  70.49                          58.25                  62.19
##   Yes     37.96  29.51                          41.75                  37.81
##      Primary Activity
##       Student Unemployed/Looking for jobs
##   No    61.10                       56.55
##   Yes   38.90                       43.45
print(secular_pl20)
##      Secular/Hindu Country
##       India is a Hindu country
##   No                     66.94
##   Yes                    33.06
##      Secular/Hindu Country
##       India is a Secular country where all religions are considered equal
##   No                                                                57.20
##   Yes                                                               42.80
print(castecensus_pl20)
##      Opinion on Caste Census
##       Can't Say    No   Yes
##   No      69.69 65.54 55.74
##   Yes     30.31 34.46 44.26
print(leadership_pl20)
##      Nature of Political Leadership
##       A democracy in which a strong leader can make decisions without interference from the parliament or the courts.
##   No                                                                                                            63.46
##   Yes                                                                                                           36.54
##      Nature of Political Leadership
##       A democracy in which elected representatives decide what becomes law.
##   No                                                                  58.68
##   Yes                                                                 41.32

###Model 4a: Preference for RG and Age, Gender (Dummy) and Nature of Locality (Dummy); Among NDA Voters

logit.fit.4a <- glm(y0 ~ s_ + age + female + rural + level_of_education, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.4a)
## 
## Call:
## glm(formula = y0 ~ s_ + age + female + rural + level_of_education, 
##     family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7614  -0.9701  -0.7432   1.2533   2.0572  
## 
## Coefficients:
##                      Estimate Std. Error z value Pr(>|z|)    
## (Intercept)        -0.1307163  0.1196665  -1.092 0.274684    
## s_Andhra Pradesh    1.4668725  0.1037744  14.135  < 2e-16 ***
## s_Assam            -0.1394486  0.1669518  -0.835 0.403570    
## s_Bihar            -0.4902411  0.0920695  -5.325 1.01e-07 ***
## s_Chhattisgarh      0.7996481  0.1329650   6.014 1.81e-09 ***
## s_Delhi            -1.0250207  0.2760753  -3.713 0.000205 ***
## s_Haryana           0.0636344  0.1565976   0.406 0.684481    
## s_Himachal Pradesh  0.0170337  0.2063466   0.083 0.934210    
## s_Jharkhand        -0.7924749  0.1190461  -6.657 2.80e-11 ***
## s_Karnataka        -1.0272201  0.1287806  -7.977 1.51e-15 ***
## s_Kerala           -0.7070464  0.2153990  -3.282 0.001029 ** 
## s_Madhya Pradesh    0.2771223  0.0956992   2.896 0.003782 ** 
## s_Maharashtra       0.1832873  0.0927872   1.975 0.048228 *  
## s_Odisha            0.7952036  0.1169712   6.798 1.06e-11 ***
## s_Punjab           -1.4616677  0.2585941  -5.652 1.58e-08 ***
## s_Rajasthan        -0.1203563  0.1037140  -1.160 0.245860    
## s_Tamil Nadu       -0.0887694  0.1460729  -0.608 0.543382    
## s_Telangana        -0.0965758  0.1282848  -0.753 0.451556    
## s_Uttar Pradesh    -0.2329299  0.0836107  -2.786 0.005338 ** 
## s_West Bengal      -0.8345951  0.1110633  -7.515 5.71e-14 ***
## age                -0.0006408  0.0014559  -0.440 0.659849    
## female              0.0043418  0.0374045   0.116 0.907592    
## rural              -0.0376707  0.0459738  -0.819 0.412561    
## level_of_education -0.0434026  0.0095548  -4.542 5.56e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 18368  on 13624  degrees of freedom
## Residual deviance: 17207  on 13601  degrees of freedom
## AIC: 17255
## 
## Number of Fisher Scoring iterations: 4

###Model 4b: Preference for RG ~ Religion (Ref == Hinduism), Caste (Ref == General); Among NDA Voters

logit.fit.4b <- glm(y0 ~ caste_religion, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.4b)
## 
## Call:
## glm(formula = y0 ~ caste_religion, family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.2097  -1.0333  -0.9579   1.3287   1.4141  
## 
## Coefficients:
##                             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                 -0.46568    0.10595  -4.395 1.11e-05 ***
## caste_religionHindu and OBC  0.11677    0.10910   1.070 0.284458    
## caste_religionHindu and SC   0.10020    0.11648   0.860 0.389693    
## caste_religionHindu and ST   0.14596    0.12345   1.182 0.237069    
## caste_religionHindu and UC  -0.07537    0.11095  -0.679 0.496954    
## caste_religionMuslim         0.54129    0.14600   3.707 0.000209 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 18368  on 13624  degrees of freedom
## Residual deviance: 18321  on 13619  degrees of freedom
## AIC: 18333
## 
## Number of Fisher Scoring iterations: 4

###Model 4c: Preference for RG ~ Primary Acitivty Dummies: Farmers, Casual Labourers, Unemployed (Among NDA Voters)

logit.fit.4c <- glm(y0 ~ farmers + unemployed + casual_labour, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.4c)
## 
## Call:
## glm(formula = y0 ~ farmers + unemployed + casual_labour, family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.0677  -0.9947  -0.9947   1.3205   1.3718  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)   -0.44626    0.02275 -19.620  < 2e-16 ***
## farmers        0.12023    0.04221   2.848  0.00439 ** 
## unemployed     0.18268    0.07830   2.333  0.01965 *  
## casual_labour  0.11607    0.05663   2.050  0.04041 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 18368  on 13624  degrees of freedom
## Residual deviance: 18355  on 13621  degrees of freedom
## AIC: 18363
## 
## Number of Fisher Scoring iterations: 4

###Model 4d: Preference for RG ~ Assent Rank (Numeric Range; c(1,5)), Ownership of AC (dummy), Ownership of Car (dummy); Among NDA Voters

logit.fit.4d <- glm(y0 ~ asset_cat, family=binomial(link = "logit"))
# Summary of the model
summary(logit.fit.4d)
## 
## Call:
## glm(formula = y0 ~ asset_cat, family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.035  -1.017  -1.008   1.347   1.357  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -0.43509    0.04215  -10.32   <2e-16 ***
## asset_cat    0.02290    0.02161    1.06    0.289    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 18368  on 13624  degrees of freedom
## Residual deviance: 18367  on 13623  degrees of freedom
## AIC: 18371
## 
## Number of Fisher Scoring iterations: 4

##Model 4e: Preference for RG ~ Political Positions: Secular/Hindu Country (dummy), Leadership (dummy), Caste Census (dummy), Likes Modi (dummy); Among NDA Voters

logit.fit.4e <- glm(y0 ~ secular + strongman + caste_census + bjp_constitution_change + inequality + inc_appeasement, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.4e)
## 
## Call:
## glm(formula = y0 ~ secular + strongman + caste_census + bjp_constitution_change + 
##     inequality + inc_appeasement, family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3588  -1.0500  -0.7585   1.1667   2.0221  
## 
## Coefficients:
##                         Estimate Std. Error z value Pr(>|z|)    
## (Intercept)             -1.47924    0.05664 -26.117   <2e-16 ***
## secular                  0.38061    0.04245   8.965   <2e-16 ***
## strongman               -0.09923    0.04455  -2.227   0.0259 *  
## caste_census             0.34351    0.03973   8.646   <2e-16 ***
## bjp_constitution_change  0.39171    0.03928   9.973   <2e-16 ***
## inequality               0.78029    0.04293  18.175   <2e-16 ***
## inc_appeasement         -0.32745    0.03932  -8.329   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 18368  on 13624  degrees of freedom
## Residual deviance: 17556  on 13618  degrees of freedom
## AIC: 17570
## 
## Number of Fisher Scoring iterations: 4

###Model 4f: Preference for RG ~ Biggest Failure of BJP: Communalisation, Unemoployment (dummies); Among NDA Voters

logit.fit.4f <- glm(y0 ~ modi_communal_caa + modi_unemployment_corrupt, family=binomial(link = "logit"))

# Summary of the model
summary(logit.fit.4f)
## 
## Call:
## glm(formula = y0 ~ modi_communal_caa + modi_unemployment_corrupt, 
##     family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.0272  -1.0272  -0.9827   1.3355   1.3987  
## 
## Coefficients:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)               -0.47697    0.04487 -10.630   <2e-16 ***
## modi_communal_caa         -0.02962    0.07349  -0.403   0.6869    
## modi_unemployment_corrupt  0.11274    0.04915   2.294   0.0218 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 18368  on 13624  degrees of freedom
## Residual deviance: 18359  on 13622  degrees of freedom
## AIC: 18365
## 
## Number of Fisher Scoring iterations: 4

###Model 4g: Preference for RG ~ All dependent variables; Among NDA Voters

logit.fit.4g <- glm(y0 ~ s_  + age + female + rural + level_of_education + caste_religion
                   + farmers + unemployed + casual_labour 
                   + asset_cat + secular + strongman + caste_census + bjp_constitution_change + inequality + inc_appeasement +                     modi_communal_caa + modi_unemployment_corrupt, family=binomial(link = "logit"))
summary(logit.fit.4g)
## 
## Call:
## glm(formula = y0 ~ s_ + age + female + rural + level_of_education + 
##     caste_religion + farmers + unemployed + casual_labour + asset_cat + 
##     secular + strongman + caste_census + bjp_constitution_change + 
##     inequality + inc_appeasement + modi_communal_caa + modi_unemployment_corrupt, 
##     family = binomial(link = "logit"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.0295  -0.9642  -0.6539   1.1396   2.3148  
## 
## Coefficients:
##                              Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                 -1.595755   0.193340  -8.254  < 2e-16 ***
## s_Andhra Pradesh             1.540599   0.109660  14.049  < 2e-16 ***
## s_Assam                      0.214192   0.175647   1.219 0.222676    
## s_Bihar                     -0.383991   0.095129  -4.037 5.42e-05 ***
## s_Chhattisgarh               0.909523   0.140110   6.492 8.50e-11 ***
## s_Delhi                     -0.962468   0.280768  -3.428 0.000608 ***
## s_Haryana                    0.318292   0.162283   1.961 0.049840 *  
## s_Himachal Pradesh           0.286321   0.217450   1.317 0.187932    
## s_Jharkhand                 -0.750291   0.122239  -6.138 8.36e-10 ***
## s_Karnataka                 -0.763721   0.133540  -5.719 1.07e-08 ***
## s_Kerala                    -0.350583   0.223730  -1.567 0.117117    
## s_Madhya Pradesh             0.394948   0.100848   3.916 8.99e-05 ***
## s_Maharashtra                0.326639   0.096944   3.369 0.000753 ***
## s_Odisha                     0.759742   0.120643   6.297 3.03e-10 ***
## s_Punjab                    -1.110891   0.267085  -4.159 3.19e-05 ***
## s_Rajasthan                 -0.027296   0.108156  -0.252 0.800748    
## s_Tamil Nadu                 0.019615   0.151978   0.129 0.897305    
## s_Telangana                 -0.057705   0.133066  -0.434 0.664535    
## s_Uttar Pradesh             -0.070436   0.086850  -0.811 0.417360    
## s_West Bengal               -0.594373   0.115360  -5.152 2.57e-07 ***
## age                          0.000792   0.001524   0.520 0.603375    
## female                       0.060316   0.041118   1.467 0.142405    
## rural                       -0.121639   0.049774  -2.444 0.014533 *  
## level_of_education          -0.022453   0.010708  -2.097 0.035997 *  
## caste_religionHindu and OBC  0.210951   0.123627   1.706 0.087942 .  
## caste_religionHindu and SC   0.264584   0.132038   2.004 0.045087 *  
## caste_religionHindu and ST   0.183152   0.139979   1.308 0.190728    
## caste_religionHindu and UC   0.131632   0.125421   1.050 0.293940    
## caste_religionMuslim         0.486563   0.162097   3.002 0.002685 ** 
## farmers                      0.134797   0.051171   2.634 0.008433 ** 
## unemployed                   0.186404   0.087352   2.134 0.032848 *  
## casual_labour                0.071873   0.066738   1.077 0.281508    
## asset_cat                   -0.019364   0.026741  -0.724 0.468988    
## secular                      0.281922   0.045229   6.233 4.57e-10 ***
## strongman                   -0.145958   0.047466  -3.075 0.002105 ** 
## caste_census                 0.360706   0.042326   8.522  < 2e-16 ***
## bjp_constitution_change      0.352918   0.041742   8.455  < 2e-16 ***
## inequality                   0.666035   0.045116  14.763  < 2e-16 ***
## inc_appeasement             -0.306194   0.041260  -7.421 1.16e-13 ***
## modi_communal_caa           -0.032283   0.082117  -0.393 0.694218    
## modi_unemployment_corrupt    0.146487   0.055763   2.627 0.008615 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 18368  on 13624  degrees of freedom
## Residual deviance: 16568  on 13584  degrees of freedom
## AIC: 16650
## 
## Number of Fisher Scoring iterations: 4

###Summary Table: Model 4

se_list <- list(rep(NA, length(coef(logit.fit.4a))), 
                rep(NA, length(coef(logit.fit.4b))), 
                rep(NA, length(coef(logit.fit.4c))), 
                rep(NA, length(coef(logit.fit.4d))), 
                rep(NA, length(coef(logit.fit.4e))), 
                rep(NA, length(coef(logit.fit.4f))),
                rep(NA, length(coef(logit.fit.4g))))

# Use stargazer and pass the cleaned names as the custom coefficient labels
summary_model4 <- stargazer(logit.fit.4a, logit.fit.4b, logit.fit.4c, logit.fit.4d, logit.fit.4e, logit.fit.4f, logit.fit.4g,
                             type = "text",          
                             title = "Characterising Potential Congress Voters",  # Table title
                             dep.var.caption = "Model4: Preference for Rahul Gandhi among NDA Voters",  # Caption for the dependent variable
                             p.auto = FALSE,           # Automatically print p-values
                             p.style = "asterisk",    # Style of p-value stars (* for coefficients only)
                             column.labels = c("4a", "4b", "4c", "4d", "4e", "4f", "4g"),
                             dep.var.labels = c("Logistic Regression Estimates/Coefficiants"), 
                             single.row = TRUE,       # Display statistics in a single row
                             digits = 2,              # Number of digits to display
                             se = se_list,
                             covariate.labels = predictor_labels
)
## 
## Characterising Potential Congress Voters
## ===================================================================================================
##                                       Model4: Preference for Rahul Gandhi among NDA Voters         
##                               ---------------------------------------------------------------------
##                                            Logistic Regression Estimates/Coefficiants              
##                                  4a        4b        4c        4d        4e        4f        4g    
##                                  (1)       (2)       (3)       (4)       (5)       (6)       (7)   
## ---------------------------------------------------------------------------------------------------
## Andhra Pradesh                 1.47***                                                     1.54*** 
## Assam                           -0.14                                                       0.21   
## Bihar                         -0.49***                                                    -0.38*** 
## Chhattisgarh                   0.80***                                                     0.91*** 
## Delhi                         -1.03***                                                    -0.96*** 
## Haryana                         0.06                                                       0.32**  
## Himachal Pradesh                0.02                                                        0.29   
## Jharkhand                     -0.79***                                                    -0.75*** 
## Karnataka                     -1.03***                                                    -0.76*** 
## Kerala                        -0.71***                                                      -0.35  
## Madhya Pradesh                 0.28***                                                     0.39*** 
## Maharashtra                    0.18**                                                      0.33*** 
## Odisha                         0.80***                                                     0.76*** 
## Punjab                        -1.46***                                                    -1.11*** 
## Rajasthan                       -0.12                                                       -0.03  
## Tamil Nadu                      -0.09                                                       0.02   
## Telangana                       -0.10                                                       -0.06  
## Uttar Pradesh                 -0.23***                                                      -0.07  
## West Bengal                   -0.83***                                                    -0.59*** 
## Age                            -0.001                                                       0.001  
## Female                          0.004                                                       0.06   
## Rural                           -0.04                                                      -0.12** 
## Level of Education            -0.04***                                                     -0.02** 
## Hindu OBC                                 0.12                                              0.21*  
## Hindu SC                                  0.10                                             0.26**  
## Hindu ST                                  0.15                                              0.18   
## Hindu UC                                  -0.08                                             0.13   
## Muslims                                  0.54***                                           0.49*** 
## Farmers                                            0.12***                                 0.13*** 
## Unemployed                                         0.18**                                  0.19**  
## Casual Labour                                      0.12**                                   0.07   
## Asset Category                                                0.02                          -0.02  
## Secular                                                                0.38***             0.28*** 
## Strongman Politics                                                     -0.10**            -0.15*** 
## Support for Caste Census                                               0.34***             0.36*** 
## BJP Constitution Change                                                0.39***             0.35*** 
## High Inequality                                                        0.78***             0.67*** 
## Congress Appeasement Politics                                         -0.33***            -0.31*** 
## Modi and Communal Politics                                                        -0.03     -0.03  
## Modi and Unemployment                                                            0.11**    0.15*** 
## Constant                        -0.13   -0.47***  -0.45***  -0.44***  -1.48***  -0.48***  -1.60*** 
## ---------------------------------------------------------------------------------------------------
## Observations                   13,625    13,625    13,625    13,625    13,625    13,625    13,625  
## Log Likelihood                -8,603.44 -9,160.60 -9,177.45 -9,183.62 -8,777.79 -9,179.48 -8,284.12
## Akaike Inf. Crit.             17,254.88 18,333.21 18,362.91 18,371.24 17,569.57 18,364.95 16,650.25
## ===================================================================================================
## Note:                                                                   *p<0.1; **p<0.05; ***p<0.01
## 
## Characterising Potential Congress Voters
## ========
## asterisk
## --------

##Models: 1h, 1i, 2h, 2i, 3h, 3i, 4h, 4i (Based on the perceived dominance of the Congress Party) ###Defining Dependent & Independent Variables

run_model <- function(data) {
  # Define outcome variable
  y0 <- ifelse(data$pl20 == "Yes", 1, 0)
  
  # States where Congress is a prominent player
  congress_prominent <- c("Punjab", "Maharashtra", "Telangana", "Assam", "Rajasthan", 
                          "Chhattisgarh", "Haryana", "Gujarat", "Karnataka", 
                          "Madhya Pradesh", "Kerala", "Himachal Pradesh")
  
  # States where Congress is a marginal player
  congress_marginal <- c("Tamil Nadu", "Uttar Pradesh", "Odisha", "Jharkhand", 
                         "Andhra Pradesh", "West Bengal", "Bihar", "Delhi")
  
  # Set state variable as factor
  data$bi1 <- as.factor(data$bi1)
  
  # Set reference level based on Congress prominence
  if (any(data$bi1 %in% congress_prominent)) {
    data$bi1 <- relevel(data$bi1, ref = "Gujarat")
  } else if (any(data$bi1 %in% congress_marginal)) {
    data$bi1 <- relevel(data$bi1, ref = "Delhi")
  }
  s_ <- data$bi1
  
  # Other predictors
  level_of_education <- data$revised_education
  age <- data$bi15
  female <- ifelse(data$bi13 == "Female", 1, 0)
  rural <- ifelse(data$bi11 == "Rural", 1, 0)
  
  data$caste_rel <- as.factor(data$caste_rel)
  data$caste_rel <- relevel(data$caste_rel, ref = "Others/Refused to Mention")
  caste_religion <- data$caste_rel
  
  farmers <- ifelse(data$dh3 == "Farmer", 1, 0)
  casual_labour <- ifelse(data$dh3 == "Daily wage labourer/Casual Labour", 1, 0)
  unemployed <- ifelse(data$dh3 == "Unemployed/Looking for jobs", 1, 0)
  
  asset_cat <- data$revised_assetcat 
  secular <- ifelse(data$c7 == "India is a Secular country where all religions are considered equal", 1, 0)
  strongman <- ifelse(data$pl35 == "A democracy in which a strong leader can make decisions without interference from the parliament or the courts.", 1, 0)
  caste_census <- ifelse(data$pov5 == "Yes", 1, 0)
  bjp_constitution_change <- ifelse(data$c11 %in% c("Agree", "Strongly Agree"), 1, 0)
  inequality <- ifelse(data$c1 %in% c("Agree", "Strongly Agree"), 1, 0)
  inc_appeasement <- ifelse(data$c12 %in% c("Agree", "Strongly Agree"), 1, 0)
  modi_communal_caa <- ifelse(data$pl34 == "Communalisation and Hurting Religious Harmony", 1, 0)
  modi_unemployment_corrupt <- ifelse(data$pl34 %in% c("Increased Unemployment", "Increased Corruption"), 1, 0)
  
  # Model fitting
  logit.fit <- glm(y0 ~ s_ + age + female + rural + level_of_education + caste_religion
                      + farmers + unemployed + casual_labour 
                      + asset_cat + secular + strongman + caste_census + bjp_constitution_change 
                      + inequality + inc_appeasement + modi_communal_caa + modi_unemployment_corrupt, 
                      family = binomial(link = "logit"))
}

###Constructing Datasets

### Filter for Congress Marginal Presence and Prominent Presence
allindia_marginal <- all_voters %>% filter(marg_prom == "Marginal")
allindia_prominent <- all_voters %>% filter(marg_prom == "Prominent")
noncongress_marginal <- non_congress %>% filter(marg_prom == "Marginal")
noncongress_prominent <- non_congress %>% filter(marg_prom == "Prominent")
nonindia_marginal <- non_india %>% filter(marg_prom == "Marginal")
nonindia_prominent <- non_india %>% filter(marg_prom == "Prominent")
nda_marginal <- nda %>% filter(marg_prom == "Marginal")
nda_prominent <- nda %>% filter(marg_prom == "Prominent")

# Running the model for Congress's marginal presence (1e)
model_1h <- run_model(allindia_marginal)
model_1i <- run_model(allindia_prominent)
model_2h <- run_model(noncongress_marginal)
model_2i <- run_model(noncongress_prominent)
model_3h <- run_model(nonindia_marginal)
model_3i <- run_model(nonindia_prominent)
model_4h <- run_model(nda_marginal)
model_4i <- run_model(nda_prominent)

##Summary Model V: Where Congress is a Prominent Player (All Voter, Non-Congress Voters, Non-India Voters and NDA Voters) ###State Reference Value: Gujarat

se_list <- list(rep(NA, length(coef(model_1i))), 
                rep(NA, length(coef(model_2i))), 
                rep(NA, length(coef(model_3i))), 
                rep(NA, length(coef(model_4i))))

predictor_labels <- c("Assam", "Chhattisgarh","Haryana", "Himachal Pradesh", "Karnataka", "Kerala", "Madhya Pradesh", "Maharashtra",  "Punjab", "Rajasthan", "Telangana", "Age","Female","Rural", "Level of Education", "Hindu OBC", "Hindu SC", "Hindu ST", "Hindu UC", "Muslims", "Farmers", "Unemployed", "Casual Labour", "Asset Category", "Secular", "Strongman Politics", "Support for Caste Census", "BJP Constitution Change", "High Inequality", "Congress Appeasement Politics", "Modi and Communal Politics", "Modi and Unemployment", "Constant")

# Use stargazer and pass the cleaned names as the custom coefficient labels
summary_model5 <- stargazer(model_1i, model_2i, model_3i, model_4i,
                             type = "text",          
                             title = "Characterising Potetial Congress Voters",  # Table title
                             dep.var.caption = "Preference for Rahul Gandhi in States where Congress is a Prominent Player",
                             p.auto = FALSE,           # Automatically print p-values
                             p.style = "asterisk",    # Style of p-value stars (* for coefficients only)
                             column.labels = c("1i All Voters", "2i Non-Congress", "3i Non-India", "4i NDA"),
                             dep.var.labels = c("Logistic Regression Estimates/Coefficiants"), 
                             single.row = TRUE,       # Display statistics in a single row
                             digits = 2,              # Number of digits to display
                             se = se_list,
                             covariate.labels = predictor_labels
)
## 
## Characterising Potetial Congress Voters
## ===========================================================================================================
##                                Preference for Rahul Gandhi in States where Congress is a Prominent Player  
##                               -----------------------------------------------------------------------------
##                                                Logistic Regression Estimates/Coefficiants                  
##                                  1i All Voters       2i Non-Congress       3i Non-India         4i NDA     
##                                       (1)                  (2)                  (3)               (4)      
## -----------------------------------------------------------------------------------------------------------
## Assam                               0.34***              0.58***              0.56***            0.13      
## Chhattisgarh                        1.11***              0.84***              0.86***           0.93***    
## Haryana                             0.66***              0.43***               0.22              0.31*     
## Himachal Pradesh                    0.89***              0.63***              0.63***            0.32      
## Karnataka                            0.15*               -0.42***            -0.43***          -0.78***    
## Kerala                              0.89***              0.84***              0.84***           -0.38*     
## Madhya Pradesh                      0.26***              0.35***              0.37***           0.40***    
## Maharashtra                         0.67***              0.70***              0.54***           0.41***    
## Punjab                               -0.01                -0.01                -0.09           -0.95***    
## Rajasthan                           0.71***                0.10                -0.06             0.02      
## Telangana                           0.38***                0.01                -0.01             -0.07     
## Age                                  0.0003               -0.001              -0.0003            0.001     
## Female                               -0.02                 0.02                0.03              -0.01     
## Rural                                 0.03                 0.07                0.08              -0.08     
## Level of Education                  -0.03***              -0.02*               -0.02             -0.02     
## Hindu OBC                           -0.30***              -0.11                -0.13            0.60***    
## Hindu SC                              0.14                 0.04                0.01             0.71***    
## Hindu ST                             -0.13                -0.03                -0.16            0.58***    
## Hindu UC                            -0.52***             -0.30***            -0.36***           0.39**     
## Muslims                             1.17***              0.99***              0.98***           0.72***    
## Farmers                               0.04                 0.04                0.03              0.07      
## Unemployed                           0.15*                0.22**               0.21*             0.21      
## Casual Labour                         0.03                 0.05               -0.002             0.02      
## Asset Category                       -0.03                -0.04                -0.05             -0.06     
## Secular                             0.65***              0.49***              0.50***           0.41***    
## Strongman Politics                  -0.43***             -0.45***            -0.48***          -0.37***    
## Support for Caste Census            0.41***              0.33***              0.30***           0.32***    
## BJP Constitution Change             0.58***              0.55***              0.50***           0.51***    
## High Inequality                     0.51***              0.53***              0.56***           0.55***    
## Congress Appeasement Politics       -0.58***             -0.44***            -0.39***          -0.19***    
## Modi and Communal Politics            0.10                 0.01                -0.04             -0.18     
## Modi and Unemployment               0.28***                0.08                0.05              -0.09     
## Constant                            -1.05***             -1.20***            -1.14***          -1.76***    
## -----------------------------------------------------------------------------------------------------------
## Observations                         14,788               10,053               8,884             5,962     
## Log Likelihood                     -8,742.66            -6,351.51            -5,611.86         -3,723.05   
## Akaike Inf. Crit.                  17,551.32            12,769.01            11,289.72         7,512.10    
## ===========================================================================================================
## Note:                                                                           *p<0.1; **p<0.05; ***p<0.01
## 
## Characterising Potetial Congress Voters
## ========
## asterisk
## --------

##Summary Model VI: Where Congress is a Marginal Player (All Voter, Non-Congress Voters, Non-India Voters and NDA Voters) ###State Reference Value: Delhi

se_list <- list(rep(NA, length(coef(model_1h))), 
                rep(NA, length(coef(model_2h))), 
                rep(NA, length(coef(model_3h))), 
                rep(NA, length(coef(model_4h))))

predictor_labels <- c("Andhra Pradesh", "Bihar", "Jharkhand", "Odisha", "Tamil Nadu", "Uttar Pradesh", "West Bengal", "Age","Female","Rural", "Level of Education", "Hindu OBC", "Hindu SC", "Hindu ST", "Hindu UC", "Muslims", "Farmers", "Unemployed", "Casual Labour", "Asset Category", "Secular", "Strongman Politics", "Support for Caste Census", "BJP Constitution Change", "High Inequality", "Congress Appeasement Politics", "Modi and Communal Politics", "Modi and Unemployment", "Constant")

# Use stargazer and pass the cleaned names as the custom coefficient labels
summary_model6 <- stargazer(model_1h, model_2h, model_3h, model_4h,
                             type = "text",          
                             title = "Characterising Potetial Congress Voters",  # Table title
                             dep.var.caption = "Preference for Rahul Gandhi in States where Congress is a Marginal Player",
                             p.auto = FALSE,           # Automatically print p-values
                             p.style = "asterisk",    # Style of p-value stars (* for coefficients only)
                             column.labels = c("1h All Voters", "2h Non-Congress", "3h Non-India", "4h NDA"),
                             dep.var.labels = c("Logistic Regression Estimates/Coefficiants"), 
                             single.row = TRUE,       # Display statistics in a single row
                             digits = 2,              # Number of digits to display
                             se = se_list,
                             covariate.labels = predictor_labels
)
## 
## Characterising Potetial Congress Voters
## ==========================================================================================================
##                                Preference for Rahul Gandhi in States where Congress is a Marginal Player  
##                               ----------------------------------------------------------------------------
##                                                Logistic Regression Estimates/Coefficiants                 
##                                  1h All Voters       2h Non-Congress       3h Non-India        4h NDA     
##                                       (1)                  (2)                 (3)               (4)      
## ----------------------------------------------------------------------------------------------------------
## Andhra Pradesh                      0.86***              1.15***             1.68***           2.58***    
## Bihar                                -0.10                 0.05               -0.02            0.65**     
## Jharkhand                           -0.42***             -0.63***             -0.37*            0.29      
## Odisha                              0.47***              0.58***             1.12***           1.80***    
## Tamil Nadu                          0.70***              0.95***             0.82***           0.98***    
## Uttar Pradesh                        0.002                 0.17               0.34*            0.92***    
## West Bengal                         -0.74***             -0.50***             -0.19             0.42      
## Age                                  0.0002               -0.001             -0.0002            0.002     
## Female                               0.06*                0.07*               0.09**           0.12**     
## Rural                               -0.11**              -0.11**              -0.06            -0.17**    
## Level of Education                  -0.03***             -0.03***            -0.03***          -0.03**    
## Hindu OBC                            -0.15                -0.06               -0.06            -0.37*     
## Hindu SC                             -0.02                 0.07                0.15             -0.34     
## Hindu ST                            -0.31**               -0.20               -0.07            -0.46**    
## Hindu UC                            -0.39***             -0.28**              -0.12            -0.36*     
## Muslims                             1.41***              1.38***             0.91***            0.02      
## Farmers                               0.08                0.11**              0.14**           0.18***    
## Unemployed                            0.10                 0.06                0.10             0.17      
## Casual Labour                        0.10*                 0.09               0.15**            0.13      
## Asset Category                        0.03                 0.02                0.04             0.02      
## Secular                             0.37***              0.34***             0.27***           0.20***    
## Strongman Politics                  -0.13***             -0.12***             -0.09*            0.03      
## Support for Caste Census            0.49***              0.48***             0.39***           0.39***    
## BJP Constitution Change             0.29***              0.29***             0.23***           0.23***    
## High Inequality                     0.64***              0.66***             0.67***           0.76***    
## Congress Appeasement Politics       -0.48***             -0.43***            -0.44***         -0.40***    
## Modi and Communal Politics          0.26***              0.26***             0.29***            0.10      
## Modi and Unemployment               0.47***              0.42***             0.38***           0.34***    
## Constant                            -0.93***             -1.24***            -1.79***         -2.23***    
## ----------------------------------------------------------------------------------------------------------
## Observations                         18,521               16,630              11,376            7,663     
## Log Likelihood                     -10,931.53           -9,989.53           -6,916.21         -4,514.02   
## Akaike Inf. Crit.                  21,921.07            20,037.06           13,890.43         9,086.03    
## ==========================================================================================================
## Note:                                                                          *p<0.1; **p<0.05; ***p<0.01
## 
## Characterising Potetial Congress Voters
## ========
## asterisk
## --------