Carregar a biblioteca:
library(electionsBR)
##
## To cite electionsBR in publications, use: citation('electionsBR')
## To learn more, visit: http://electionsbr.com
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
# download da base de dados:
banco2 = candidate_fed(year = 2018,uf="MT")
## Processing the data...
## Done.
Questão de pesquisa:
Quais são os partidos que não estão respeitando a cota de 30% para
mulheres nas eleições proporcionais em Mato Grosso?
Tabela de relacionamento:
dep_fed_2018 = banco2 %>% filter(DS_CARGO=="DEPUTADO FEDERAL")
tabela_dep_fed = table(dep_fed_2018$SG_PARTIDO,dep_fed_2018$DS_GENERO)
tabela_dep_fed
##
## FEMININO MASCULINO
## AVANTE 2 6
## DC 1 4
## DEM 2 1
## MDB 3 4
## NOVO 4 9
## PATRIOTA 0 3
## PC do B 1 1
## PCO 0 1
## PDT 1 4
## PHS 0 3
## PMB 0 1
## PMN 0 1
## PODE 0 2
## PP 0 2
## PPL 2 1
## PPS 2 4
## PR 0 2
## PRB 1 0
## PROS 2 2
## PRP 1 2
## PRTB 5 6
## PSB 1 4
## PSC 5 4
## PSD 0 2
## PSDB 2 3
## PSL 3 2
## PSOL 4 6
## PT 2 0
## PTB 1 1
## PTC 1 1
## PV 4 5
## REDE 1 6
## SOLIDARIEDADE 2 1
Tabela de proporção:
prop.table(tabela_dep_fed,1)*100
##
## FEMININO MASCULINO
## AVANTE 25.00000 75.00000
## DC 20.00000 80.00000
## DEM 66.66667 33.33333
## MDB 42.85714 57.14286
## NOVO 30.76923 69.23077
## PATRIOTA 0.00000 100.00000
## PC do B 50.00000 50.00000
## PCO 0.00000 100.00000
## PDT 20.00000 80.00000
## PHS 0.00000 100.00000
## PMB 0.00000 100.00000
## PMN 0.00000 100.00000
## PODE 0.00000 100.00000
## PP 0.00000 100.00000
## PPL 66.66667 33.33333
## PPS 33.33333 66.66667
## PR 0.00000 100.00000
## PRB 100.00000 0.00000
## PROS 50.00000 50.00000
## PRP 33.33333 66.66667
## PRTB 45.45455 54.54545
## PSB 20.00000 80.00000
## PSC 55.55556 44.44444
## PSD 0.00000 100.00000
## PSDB 40.00000 60.00000
## PSL 60.00000 40.00000
## PSOL 40.00000 60.00000
## PT 100.00000 0.00000
## PTB 50.00000 50.00000
## PTC 50.00000 50.00000
## PV 44.44444 55.55556
## REDE 14.28571 85.71429
## SOLIDARIEDADE 66.66667 33.33333
barplot(tabela_dep_fed)

Relatório:
Os seguintes partidos saõ os que não respeitaram a cota de 30% para
mulheres nas eleições proporcionais de 2018 no Mato Grasso: AVANTE, DC,
PATRIOTA, PCO, PDT, PHS, PHS, PMB, PMN, PODE, PP, PR, PSB, PSD e
REDE.