Referências

Lovell, P. A. Raça, classe, gênero e discriminação salarial no Brasil. Estudos Afro-asiáticos, Rio de Janeiro, n. 22, p. 85-98, setembro de 1992.

Wood, C. H.; Carvalho, J. A. M. de. A demografia da desigualdade no Brasil. Rio de Janeiro: IPEA, 1994.

Citações

R

R Core Team (2019). R: A language and environment for statistical computing. R fundation for Statistical Computing, Vienna, Austria. URL https://www.R-project.org/.

Pacotes

Hadley Wickham and Jennifer Bryan (2019). readxl: Read Excel Files. R package version 1.3.1. https://CRAN.R-project.org/package=readxl

Hadley Wickham (2017). tidyverse: Easily Install and Load the Tidyverse. R package version 1.2.1. https://CRAN.R-project.org/package=tidyverse

Scrucca, L. (2004). qcc: an R package for quality control charting and statistical process control. R News 4/1, 11-17. Baptiste Auguie (2017). gridExtra: Miscellaneous Functions for “Grid” Graphics. R package version 2.3. https://CRAN.R-project.org/package=gridExtra

Andri Signorell et mult. al. (2019). DescTools: Tools for descriptive statistics. R package version 0.99.30. Barret Schloerke, Jason Crowley, Di Cook, Francois Briatte, Moritz Marbach, Edwin Thoen, Amos Elberg and Joseph Larmarange (2018). GGally: Extension to ggplot2. R package version 1.4.0. https://CRAN.R-project.org/package=GGally

Bob Rudis (2019). hrbrthemes: Additional Themes, Theme Components and Utilities for ggplot2. R package version 0.6.0. https://CRAN.R-project.org/package=hrbrthemes

Frank E Harrell Jr, with contributions from Charles Dupont and many others. (2019). Hmisc: Harrell Miscellaneous. R package version 4.3-0. https://CRAN.R-project.org/package=Hmisc

Taiyun Wei and Viliam Simko (2017). R package corrplot: Visualization of a Correlation Matrix (Version 0.84). Available from https://github.com/taiyun/corrplot

Taiyun Wei and Viliam Simko (2017). R package corrplot: Visualization of a Correlation Matrix (Version 0.84). Available from https://github.com/taiyun/corrplot

H. Wickham. ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2016. Revelle, W. (2018) psych: Procedures for Personality and Psychological Research, Northwestern University, Evanston, Illinois, USA, https://CRAN.R-project.org/package=psych Version = 1.8.12

Revelle, W. (2018) psych: Procedures for Personality and Psychological Research, Northwestern University, Evanston, Illinois, USA, https://CRAN.R-project.org/package=psych Version = 1.8.12.

Hadley Wickham (2011). The Split-Apply-Combine Strategy for Data Analysis. Journal of Statistical Software, 40(1), 1-29. URL http://www.jstatsoft.org/v40/i01/.

Claus O. Wilke (2018). ggjoy: Joyplots in ggplot2. R package version 0.4.1. https://CRAN.R-project.org/package=ggjoy

Anexo

library(ggplot2)
if(!require("readxl")) install.packages("readxl"); library(readxl)
if(!require("tidyverse")) install.packages("tidyverse"); library(tidyverse)
if(!require("qcc")) install.packages("qcc"); library(qcc)
if(!require("gridExtra")) install.packages("gridExtra"); library(gridExtra)
if(!require("DescTools")) install.packages("DescTools"); library(DescTools)
if(!require("ggrepel")) install.packages("ggrepel"); library(ggrepel)
if(!require("GGally")) install.packages("GGally"); library(GGally)
if(!require("hrbrthemes")) install.packages("hrbrthemes"); library(hrbrthemes)
if(!require("dplyr")) install.packages("dplyr"); library(dplyr)
if(!require("Hmisc")) install.packages("Hmisc"); library(Hmisc)
if(!require("corrplot")) install.packages("corrplot"); library(corrplot)
if(!require("PerformanceAnalytics")) install.packages("PerformanceAnalytics"); library(PerformanceAnalytics)
if(!require("ggplot2")) install.packages("ggplot2"); library(ggplot2)
if(!require("psych")) install.packages("psych"); library(psych)
if(!require("plyr")) install.packages("plyr"); library(plyr)
if(!require("plotly")) install.packages("plotly"); library(plotly)
if(!require("ggjoy")) install.packages("ggjoy"); library(ggjoy)
library(viridis)
library(gapminder)

dados <- read_excel("dados.xlsx")

dados <- dados%>%rename(Envelhecimento='Grau de envelhecimento',
                        Pobreza='Índice de pobreza',
                        Habitantes='ano',
                        a2='0 a 2',
                        a5='5 a 10',
                        a10= '5 a 10',
                        a20= '10 a 20',
                        mq20='Acima de 20',
                        sr='Sem rendimento',
                        Reg = 'Região',
                        Alfabet = 'Alfabetização')
dados <- dados%>%mutate(Reg=as.factor(Reg))

d1 <- ggplot(dados, aes(Reg, y=Branca, fill=Reg)) + 
  geom_violin(trim=FALSE,width=1.25) + 
  stat_summary(fun.y=median,geom="point",size=1.5,color="white") + 
  stat_summary(fun.y=mean,geom="point", size=1.5, color='black') + 
  labs(x="Regiões de Salvador-BA",y="População Branca (%)") + 
  scale_fill_brewer(palette = "RdBu") + theme_minimal()
d1

d2 <- ggplot(dados, aes(Reg, y=Preta, fill=Reg)) + 
  geom_violin(trim=FALSE,width=1.25) + 
  stat_summary(fun.y=median,geom="point",size=1.5,color="white") + 
  stat_summary(fun.y=mean,geom="point", size=1.5, color='black') + 
  labs(x="Regiões de Salvador-BA",y="População Preta (%)") + 
  scale_fill_brewer(palette = "RdBu") + theme_minimal()
d2

dados <- data.frame(dados)
dados <- mutate(dados,Nome=as.factor(Nome))


p <- dados %>%
  mutate(mq20=round(mq20,0)) %>%
  mutate(Habitantes=round(Habitantes/1000,2)) %>%
  mutate(sr=round(sr,1)) %>%
  arrange(desc(Habitantes)) %>%
  mutate(Nome=factor(Nome,Nome)) %>%
  mutate(text=paste("Bairro: ",Nome, "\nHabitantes (mil): ",Habitantes, "\nSem rendimento (%): ",sr, "\nMais de 20 salários mínimo (%): ",mq20,sep="")) %>%
  ggplot(aes(x=mq20, y=sr, size=Habitantes, color=Reg, text=text))+
  geom_point(alpha=0.7)+
  scale_size(range=c(1.4,19), name="Região de Salvador-BA")+
  scale_color_viridis(discrete = TRUE, guide=FALSE)+
  theme_ipsum()+
  theme(legend.position = "Região") + xlab("Mais de 20 Salários (%)") +
  ylab("Sem Rendimento (%)")

pp <- ggplotly(p, tooltip = "text")
pp  

c1 <- ggplot(dados,aes(x=Analfabetismo, y=Reg, fill=Reg))+
  geom_joy(scale=4)
c2 <- ggplot(dados,aes(x=Alfabet, y=Reg, fill=Reg))+
  geom_joy(scale=4)
c3 <- ggplot(dados,aes(x=Pobreza, y=Reg, fill=Reg))+
  geom_joy(scale=4)
c4 <- ggplot(dados,aes(x=Envelhecimento, y=Reg, fill=Reg))+
  geom_joy(scale=4)
c1
c2
c3
c4

a2 <- dados%>%select(Branca,Preta,Analfabetismo,Alfabet,Envelhecimento,Pobreza)
corr <- a2 %>%
  as.matrix() %>%
  rcorr() %>%
  na.omit()
mc <- corr$r
corrplot(mc)
corrplot(mc,p.mat = corr$P, method = "number", type = "upper")
a2 %>%
chart.Correlation(histogram=TRUE)

’`