t-test

Variables:

dmcntov: How democratic [country] is overall - “0” means not democratic at all, “10” means fully democratic

gndr: Gender

Hypothesis

We assume that there is significant difference between how males and females evaluate how democratic Ukraine:

H0 - there is no significant difference between genders.

H1 - there is significant difference between genders.

Firstly test our variable on normality:

## 
##  Shapiro-Wilk normality test
## 
## data:  as.numeric(DA2$dmcntov)
## W = 0.96228, p-value < 0.00000000000000022

QQ-plot and Shapiro-Wilk normality test show that our variable haven’t normal distribution.

Secondly test homogeneity of variance in groups:

#Bartlett:
bartlett.test(DA2$dmcntov~DA2$gndr)
## 
##  Bartlett test of homogeneity of variances
## 
## data:  DA2$dmcntov by DA2$gndr
## Bartlett's K-squared = 0.063856, df = 1, p-value = 0.8005
#Levene:
car::leveneTest(DA2$dmcntov~DA2$gndr)
## Levene's Test for Homogeneity of Variance (center = median)
##         Df F value Pr(>F)
## group    1  0.7668 0.3813
##       1958

The p-values of Levene Test=0.3813 and Bartlett Test=0.8005 both above the significance level of 0.05 so we can assume that variances are equal.

t.test(DA2$dmcntov~DA2$gndr, var.equal = T)
## 
##  Two Sample t-test
## 
## data:  DA2$dmcntov by DA2$gndr
## t = -4.2878, df = 1958, p-value = 0.00001893
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.7281001 -0.2710835
## sample estimates:
##   mean in group Male mean in group Female 
##             3.722449             4.222041
ggplot() +
  geom_boxplot(data = DA2, aes(x = gndr, y = dmcntov)) + 
  xlab("Gender") + 
  ylab("How democratic Ukraine is overall") + 
  ggtitle("Gender on how democratic Ukraine is overall") +
  theme_bw()

With p-value=0.00001995 we reject H0 hypothesis, therefore, different groups define how Ukraine democratic overall.

chi-square

Variables:

vote: Voted last national election: “1” means “Yes”, “2” means “No”.

gndr: Gender: “1” means “Male”, “2” means “Female”.

Hypothesis:

We assume that females and males voted differently - gender had influence on voting behaviour on the last national elections.

H0 - there is no significant association between gender and voting behaviour.

H1 - there is significant association between gender and voting behaviour.

table(DA2$vote, DA2$gndr, dnn = c("Gender","Voted"))
##       Voted
## Gender Male Female
##    Yes  543    976
##    No   192    249
ch <- chisq.test(DA2$vote, DA2$gndr)
ch
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  DA2$vote and DA2$gndr
## X-squared = 8.5204, df = 1, p-value = 0.003512

With p-value=0.003512 we can decline H0-hypothesis and say that there is significant association between categories. From that we can assume that gender may have influence on voting behaviour on the last national elections.