## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.4.4     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
## 
## Attaching package: 'kableExtra'
## 
## 
## The following object is masked from 'package:dplyr':
## 
##     group_rows
## 
## 
## Loading required package: ggpp
## 
## Registered S3 methods overwritten by 'ggpp':
##   method                  from   
##   heightDetails.titleGrob ggplot2
##   widthDetails.titleGrob  ggplot2
## 
## 
## Attaching package: 'ggpp'
## 
## 
## The following object is masked from 'package:ggplot2':
## 
##     annotate
## 
## 
## Registered S3 method overwritten by 'ggpmisc':
##   method                  from   
##   as.character.polynomial polynom
## 
## 
## Attaching package: 'janitor'
## 
## 
## The following objects are masked from 'package:stats':
## 
##     chisq.test, fisher.test

1 INC vote share

1.1 Vote share range of INC in 2014 elections

Vote_share Number_of_seats
0.0 79
0.1-16.6 178
16.7-30 93
30.1-45 171
45_above 21
others 1

1.2 Vote share range of INC in 2009 elections

Vote_share Number_of_seats
0.0 103
0.1-16.6 71
16.7-30 61
30.1-45 197
45_above 111

1.3 Vote share of INC in 2019 elections

Vote_share2019 Number_Of _Seats
0.0 122
0.1-16.6 148
16.7-30 68
30.1-45 167
45_above 38

1.4 Vote share of INC 2019 and 2014 combined

Combined_Vote_Share Number_Of_Seats
0 54
0.1-16.67 110
16.67-35 77
35-40 15
above 40 40
others 246

1.5 Vote share of INC 2019 and 2014 combined

Vote_share14_19 Number_of_seats
0-16.67 85
16.7-30 29
30.1-45 110
45_above 8
Others 295

2 INC MLA

2.1 Number of INC MLA over the Years

Period MLA_BJP MLA_INC MLA_Others
1984-1987 199 1802 1860
1988-1991 799 1383 2292
1992-1995 736 895 1437
1994-1999 656 1154 1725
2000-2003 777 777 1728
2004-2007 587 844 2026
2008-2011 593 970 1617
2012-2015 1018 764 1584
2016-2019 1200 862 1654
2020-2023 1240 571 1307

3 Vote share difference from winner and losers

3.1 Seats Where Congress won in 2014 but lost in 2019

3.2 Vote share difference of congress from runner up in winning seats

3.3 vote share difference from winner where it lost

## `geom_smooth()` using formula = 'y ~ x'

4 INC AND BJP Combined vote share scatter

4.1 PLOT-1

## `geom_smooth()` using formula = 'y ~ x'

5 Turnout Analysis

5.1 combined bjp and inc

## `geom_smooth()` using formula = 'y ~ x'

## `geom_smooth()` using formula = 'y ~ x'

5.2 2014 and 2019 turnout and vote share of BJP and INC

## `geom_smooth()` using formula = 'y ~ x'

5.3 Turnout and vote share scatter of 2009 and 2014

## `geom_smooth()` using formula = 'y ~ x'

5.4 Turnout and voteshare scatter of 2009 and 2019

## `geom_smooth()` using formula = 'y ~ x'

5.5 Scatter plot 2009 and 2014 vote share

## $x
## [1] "2009 vote share seatwise"
## 
## $y
## [1] "2014 vote share seatwise"
## 
## $title
## [1] "Scatter Plot 2009 and 2014 voteshare"
## 
## attr(,"class")
## [1] "labels"
## `geom_smooth()` using formula = 'y ~ x'

6 INC Urban Rural

6.1 Table

## 
## 
## Table: Urban Rural Performance of INC
## 
## | Year|Percentile | Seats_won| Vote_Share| seat_share| strike_rate|
## |----:|:----------|---------:|----------:|----------:|-----------:|
## | 2009|Most Rural |        62|      37.05|      49.60|       54.39|
## | 2009|25-50%     |        47|      28.89|      36.15|       46.53|
## | 2009|50%-75%    |        41|      26.35|      30.60|       36.94|
## | 2009|Most Urban |        41|      20.28|      31.06|       44.57|
## | 2014|Most Rural |        13|      29.21|      10.40|       11.50|
## | 2014|25-50%     |         9|      22.96|       6.92|        7.83|
## | 2014|50%-75%    |         9|      15.39|       6.72|        8.33|
## | 2014|Most Urban |        13|      13.15|       9.85|       12.26|
## | 2019|Most Rural |         8|      27.40|       5.93|        6.61|
## | 2019|25-50%     |        10|      20.61|       7.46|        9.80|
## | 2019|50%-75%    |        21|      17.05|      15.67|       21.21|
## | 2019|Most Urban |        12|      12.64|       8.89|       12.77|
## 
## __Note:__
## ^a^Note: This data doesn't include Dadar and Nagar Haveli,Daman and Div,Chandigarh,Lakshdweep, Andman and Nicobar and Chandigarh. 
## Source:European Satalite Agency and Global Human Settlement Layer

6.2 Urban Rural vote share plot

# Party Workers Survey

7 INC Turnout Change and Winning Probability

7.1 2019 and 2014

## Install package "strengejacke" from GitHub (`devtools::install_github("strengejacke/strengejacke")`) to load all sj-packages at once!
## Rows: 91669 Columns: 45
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (19): State_Name, Candidate, Sex, Party, Candidate_Type, Constituency_Na...
## dbl (20): Assembly_No, Constituency_No, Year, month, Poll_No, DelimID, Posit...
## lgl  (6): last_poll, Same_Constituency, Same_Party, Turncoat, Incumbent, Rec...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## 
## Call:
## glm(formula = Category ~ vs_difference_1914, family = "binomial", 
##     data = main)
## 
## Coefficients:
##                    Estimate Std. Error z value Pr(>|z|)    
## (Intercept)        -2.22037    0.14629 -15.177   <2e-16 ***
## vs_difference_1914 -0.04837    0.03716  -1.302    0.193    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 342.82  on 542  degrees of freedom
## Residual deviance: 341.13  on 541  degrees of freedom
## AIC: 345.13
## 
## Number of Fisher Scoring iterations: 5
## Data were 'prettified'. Consider using `terms="vs_difference_1914
##   [all]"` to get smooth plots.

7.2 2009 and 2014

## Rows: 91669 Columns: 45
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (19): State_Name, Candidate, Sex, Party, Candidate_Type, Constituency_Na...
## dbl (20): Assembly_No, Constituency_No, Year, month, Poll_No, DelimID, Posit...
## lgl  (6): last_poll, Same_Constituency, Same_Party, Turncoat, Incumbent, Rec...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## 
## Call:
## glm(formula = Category ~ vs_difference_0914, family = "binomial", 
##     data = main_1)
## 
## Coefficients:
##                    Estimate Std. Error z value Pr(>|z|)    
## (Intercept)        -1.84217    0.21269  -8.661  < 2e-16 ***
## vs_difference_0914 -0.09039    0.02733  -3.307 0.000943 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 305.47  on 542  degrees of freedom
## Residual deviance: 293.85  on 541  degrees of freedom
## AIC: 297.85
## 
## Number of Fisher Scoring iterations: 5
## Data were 'prettified'. Consider using `terms="vs_difference_0914
##   [all]"` to get smooth plots.

7.3 2009 and 2019

## 
## Call:
## glm(formula = Category ~ vs_difference_0919, family = "binomial", 
##     data = maiin_2)
## 
## Coefficients:
##                    Estimate Std. Error z value Pr(>|z|)    
## (Intercept)        -1.69364    0.17402  -9.733  < 2e-16 ***
## vs_difference_0919 -0.08321    0.01923  -4.327 1.51e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 342.82  on 542  degrees of freedom
## Residual deviance: 323.03  on 541  degrees of freedom
## AIC: 327.03
## 
## Number of Fisher Scoring iterations: 5
## Data were 'prettified'. Consider using `terms="vs_difference_0919
##   [all]"` to get smooth plots.