Gráfico densidade de Estresse divido por categoria
Nesse gráfico é possível visualizar, no eixo y, a densidade de pessoas divida em nas categorias: Não precisa de tratamento, Precisa de tratamento, Monitorar. Além disso é possível ver a escala do nível de Estresse no eixo x.
library(Rcmdr)
## Loading required package: splines
## Loading required package: RcmdrMisc
## Loading required package: car
## Loading required package: carData
## Loading required package: sandwich
## Loading required package: effects
## lattice theme set by effectsTheme()
## See ?effectsTheme for details.
## A interface gráfica do Rcmdr só é lançada no modo interativo
##
## Attaching package: 'Rcmdr'
## The following object is masked from 'package:car':
##
## Confint
DF_STRESS <-
readXL("C:/Users/Matheus/Desktop/Base_de_dados-master/Questionario_Estresse.xls",
rownames=FALSE, header=TRUE, na="", sheet="Dados", stringsAsFactors=TRUE)
# library
library(ggridges)
library(ggplot2)
##
## Attaching package: 'ggplot2'
## The following object is masked from 'package:ggridges':
##
## scale_discrete_manual
#INTERVALOS
DF_STRESS$variable <- with(DF_STRESS, binVariable(Estresse, bins=3, method='intervals', labels=c('Não Precisa de Tratamento','Monitorar',
'Precisa de Tratamento')))
# GRÁFICO
ggplot(DF_STRESS, aes(x = Estresse, y = DF_STRESS$variable, fill = DF_STRESS$variable),ylab="NÍVEIS DE ESTRESSE") +
geom_density_ridges() +
theme_ridges() +
theme(legend.position = "none")
## Picking joint bandwidth of 1.44