Variables:
dmcntov: How democratic [country] is overall - “0” means not democratic at all, “10” means fully democratic
gndr: Gender
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.
##
## Shapiro-Wilk normality test
##
## data: as.numeric(DA2$dmcntov)
## W = 0.96228, p-value < 0.00000000000000022
#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
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()
Variables:
vote: Voted last national election: “1” means “Yes”, “2” means “No”.
gndr: Gender: “1” means “Male”, “2” means “Female”.
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