You are on page 1of 3

install.

packages("pwr")
install.packages("knitr")
install.packages("tables")
library(ggplot2)
library(dplyr)

library(tidyverse)
Data<-read.csv("https://www.dropbox.com/s/aw0x8uxlhkkzcxi/Datos
%20Clasificaci%C3%B3n%20Hospital%20-%20Proyecto%20inferencia
%202020%20I.csv?dl=1", sep=",")
head(Data)
 str(Data)

1.¿El precio que se debe pagar por los servicios recibidos en el hospital incrementa
por la selección de comida durante la estadía del paciente?

ggplot(Data, aes(x=AE_ATTENDEEFOOD,y=Estimatedcost))+geom_point()
#Diagrama de dispersión

2.

ggplot(Data, aes(x=NPS_Status, FILL=INR_ROOMCLEANLINESS))+geom_bar()
+labs(title="Limpieza de la habitacion VS Status del NPS")

3. ggplot(Data, aes(x=InsPayorcategory, fill=FNB_FOODQUALITY))
+geom_bar()+labs(title="Frecuencia Absolutas")+scale_fill_manual()

4.

ggplot(Data, aes(x=EM_IMMEDIATEATTENTION,y=FNB_FOODQUALITY))
+geom_point()

5.

#analisis de departamento y dieta 
Tabla5.1<- Data%>%group_by(Department)%>
%summarise(Promedio=mean(FNB_DIETICIAN), Desviacion=sd(FNB_DIETICIAN), 
cantidad=n())
Tabla5.1 
ggplot(Data, aes(x=Department, y=FNB_DIETICIAN))+geom_boxplot(aes(fill 
= Department))+ stat_boxplot(geom ='errorbar')+ labs(title =' Departam
ento vs Dieta ', x= 'Departamento',y='Dieta', fill='Departamento')+ th
eme_classic()
+scale_fill_manual(values=c("violetred2","blue4","pink","green","skybl
ue","red","gold"))

#analisis Status_NPS Y Dieta 
Tabla5.2<- Data%>%group_by(NPS_Status)%>
%summarise(Promedio=mean(FNB_DIETICIAN), Desviacion=sd(FNB_DIETICIAN), 
cantidad=n())
Tabla5.2
ggplot(Data, aes(x=NPS_Status, y=FNB_DIETICIAN))+geom_boxplot(aes(fill 
= NPS_Status))+ stat_boxplot(geom ='errorbar')+ labs(title =' Status N
PS vs Dieta ', x= 'Status NPS',y='Dieta', fill='Status_NPS')+ theme_cl
assic()+scale_fill_manual(values=c("pink","green","skyblue"))

#Analisis Status NPS y Departamento 
Tabla5.3<- table(Data$NPS_Status,Data$Department)
Tabla5.3
ggplot(Data, aes(x=Department, fill=NPS_Status))+geom_bar()
+labs(title="Frecuencia Absolutas NPS_Status vs Departamento")

6.

Tabla6<-Data%>%group_by(Data$OVS_OVERALLSTAFFATTITUDE)%>
%summarise(ndatos=n(),Promedio=mean(CE_NPS), Desviacion=sd(CE_NPS), va
rianza=var(CE_NPS))
Tabla6

ggplot(Data, aes(x=OVS_OVERALLSTAFFATTITUDE, y=CE_NPS))
+geom_boxplot(aes(fill = OVS_OVERALLSTAFFATTITUDE))+ stat_boxplot(geom 
='errorbar')+ labs(title =' PUNTAJE NPS VS OVERALL STAFF ATTITUDE ', x
= 'NIVEL DE SATISFACCION OVS',y='PUNTAJE NPS', fill='OVERALL STAFF ATT
ITUDE')+ theme_classic()+scale_fill_manual(values=c("pink","skyblue"))

ggplot(Data, aes(x=OVS_OVERALLSTAFFATTITUDE, y=CE_NPS))
+geom_boxplot(aes(fill = OVS_OVERALLSTAFFATTITUDE))+ stat_boxplot(geom 
='errorbar')+ labs(title =' PUNTAJE NPS VS OVERALL STAFF ATTITUDE ', x
= 'NIVEL DE SATISFACCION OVS',y='PUNTAJE NPS', fill='OVERALL STAFF ATT
ITUDE')+ theme_classic()+scale_fill_manual(values=c("pink","skyblue"))

7.

ggplot(Data, aes(x=Sex, y=CE_NPS))+geom_boxplot(aes(fill = Sex))+ stat
_boxplot(geom ='errorbar')+ labs(title =' Sexo VS NPS',y='Puntaje NPS
', fill='Sexo')+ theme_classic()+scale_fill_manual(values=c("pink", "s
kyblue"))

8.

Tabla8<-Data%>%group_by(STATEZONE)%>%summarise(Promedio=mean(CE_NPS), 
Desviacion=sd(CE_NPS), Varianza=var(Data$CE_NPS),ndatos=n())
Tabla8

ggplot(Data, aes(x=STATEZONE, y=CE_NPS))+geom_boxplot(aes(fill =STATEZ
ONE))+ stat_boxplot(geom ='errorbar')+ labs(title =' Zona vs Puntaje 
', x= 'Zona',y='Puntaje', fill='Pais')+ theme_classic()
+scale_fill_manual(values=c("violetred2","blue4","pink","green","skybl
ue","red","gold"))

You might also like