Marriage Equality Support & Voting Behaviour

A relationship between support for marriage equality and support for particular political parties?

Gavin Height - 3873959

25 Oct 2020

Introduction

Introduction Cont.

Problem Statement

Data

Data Cont.

Descriptive Statistics and Visualisation

tpp1 <- read_csv("HouseTppByDivisionDownload-24310.csv", skip=1)
marriage1 <- read_excel("australian_marriage_law_postal_survey_2017_-_response_final.xls", sheet=3, skip= 5)
marriage2 <- rename(marriage1, electorate =...1, yes_votes = Yes, yes_percentage=...3, no_votes= No, no_percentage = ...5, total_votes = Total...6, total_percentage = ...7)
tpp2 <- rename(tpp1,electorate=DivisionNm)
marriage3 <- marriage2 %>% select(electorate,yes_votes,yes_percentage,no_votes,no_percentage,total_votes)
voting1 <- tpp2 %>% left_join(marriage3)

voting1$StateAb <- voting1$StateAb%>% as.factor()
voting1$PartyAb <-  voting1$PartyAb %>% as.factor()
voting1$yes_votes <- voting1$yes_votes %>% as.double()
voting1$yes_percentage <- voting1$yes_percentage %>% as.double()
voting1$no_votes <- voting1$no_votes %>% as.double()
voting1$no_percentage <- voting1$no_percentage %>% as.double()
voting1$total_votes <- voting1$total_votes %>% as.double()

voting1$Swing[148] <- NA
voting1$yes_percentage[25] <- 74.1
voting1$no_percentage [25] <- 25.9
voting1$yes_percentage[50] <- 74
voting1$no_percentage[50] <- 26
voting1$yes_percentage[92] <- 54.5
voting1$no_percentage[92] <- 45.5 
voting1 <- voting1[-c(8,31,33,58,98,117,111,137), ]

voting2 <- mutate(voting1, difference = yes_percentage - no_percentage)

voting2$tpp <- voting2$PartyAb %>% fct_recode( "Coalition" = "LNP", "Coalition" = "LP", "Coalition" = "NP", "ALP" = "ALP")

seat_perc <- voting2$tpp %>% table() %>% prop.table()*100
seat_perc %>% barplot(main="Percentage of Seats Won", ylab = "Percent", ylim = c(0,60))

Decsriptive Statistics Cont.

voting2 %>% group_by(tpp) %>% summarise(Min = min(yes_percentage,na.rm = TRUE),
                                           Q1 = quantile(yes_percentage,probs = .25,na.rm = TRUE),
                                           Median = median(yes_percentage, na.rm = TRUE),
                                           Q3 = quantile(yes_percentage,probs = .75,na.rm = TRUE),
                                           Max = max(yes_percentage,na.rm = TRUE),
                                           Mean = mean(yes_percentage, na.rm = TRUE),
                                           SD = sd(yes_percentage, na.rm = TRUE),
                                           n = n(),
                                           Missing = sum(is.na(yes_percentage))) -> table1
knitr::kable(table1)
tpp Min Q1 Median Q3 Max Mean SD n Missing
ALP 26.1 54.575 64.25 68.725 83.7 60.94844 12.613221 64 0
Coalition 43.9 55.150 61.10 64.700 80.8 60.90633 7.757632 79 0
voting2 %>% boxplot(yes_percentage ~ tpp, data = .,main= "Yes Support by Party Preference",ylab = "Yes Support (Percentage)", xlab = "Two Party Preferred")

Hypothesis Testing

Next we checked to see if there was a relationship between voting behaviour for either of the two political parties and voting behaviour on marriage equality, on an electorate level.

The null hypothesis was that there was not a statistically significant difference for marriage equality support between the two political party voting groups. \[H_0: \mu_1 = \mu_2 \] The alternate hypothesis was that there was a statistically significant difference. \[H_A: \mu_1 \ne \mu_2\]

As can be seen in the results below, with a P value of 0.98, the null hypothesis was failed to be rejected.

model1 <- lm(yes_percentage ~ tpp, data = voting2)
model1 %>% summary()
## 
## Call:
## lm(formula = yes_percentage ~ tpp, data = voting2)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -34.848  -5.856   0.794   6.752  22.752 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  60.94844    1.27706  47.726   <2e-16 ***
## tppCoalition -0.04211    1.71816  -0.025     0.98    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.22 on 141 degrees of freedom
## Multiple R-squared:  4.26e-06,   Adjusted R-squared:  -0.007088 
## F-statistic: 0.0006006 on 1 and 141 DF,  p-value: 0.9805
leveneTest(yes_percentage ~ tpp, data= voting2)
alp <-subset(voting2,tpp =="ALP")
Lib<-subset(voting2, tpp !="ALP")
yesp <-t.test(alp$yes_percentage,Lib$yes_percentage)
yesp
## 
##  Welch Two Sample t-test
## 
## data:  alp$yes_percentage and Lib$yes_percentage
## t = 0.023366, df = 99.948, p-value = 0.9814
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -3.533258  3.617475
## sample estimates:
## mean of x mean of y 
##  60.94844  60.90633

Discussion

References