Gestión de Sistema de Información

Nombre y Apellido: José Alberto Palomino Herrera y Pari Cayo Yony

Curso: Estadistica Aplicada a la Computación

Docente: Victor Manuel Guevara Ponce

Ciclo: IV

Año: 2023


#Resumen
Se propone analizar el desarrollo de una guía de viajes sobre los lugares imprescindibles de la India, respaldada por datos estadísticos. La iniciativa se centra en evaluar la popularidad y preferencias de destinos turísticos, analizar la distribución geográfica de lugares destacados, y comprender tendencias en el comportamiento de turistas nacionales e internacionales.

#I.Aspectos generales
1.1 Nombre de la organización y/o empresa (real o propuesta):
-Organización: Ministerio de Turismo de la India.
-Empresa: Agencia de Viajes “Explora India.

1.2 Descripción del caso (o los casos) que se va a analizar:
Caso: Desarrollo de una guía de viajes sobre los lugares imprescindibles de la India. La guía se basará en datos recopilados de diversas fuentes para proporcionar información detallada y recomendaciones a los turistas que visitan el país.

#II.Fundamentos básicos de la Estadística
2.1 Objetivo de estudio:
-Evaluar la popularidad y preferencias de destinos turísticos en la India.
-Identificar tendencias y patrones en el comportamiento de los turistas.

2.2 Población de estudio:
-Población: Turistas que visitan la India.
-Subpoblaciones: Turistas nacionales e internacionales.

2.3 Muestra:
-Muestra representativa de turistas recientes.
-Inclusión de diferentes perfiles de turistas (edad, nacionalidad, preferencias de viaje).

2.4 Unidad de análisis:
-La unidad de análisis será cada turista y sus preferencias de viaje.
-También se analizarán conjuntos de datos relacionados con la popularidad de destinos específicos.

#Archivo Obtenido:
https://www.kaggle.com/datasets/saketk511/travel-dataset-guide-to-indias-must-see-places

#III. Variable y tipo de variable

#IV.Manejo de Base de Datos

viajes <- read.csv("turismo.csv", sep=",")
head(viajes)
##   X     Zone State  City                 Name         Type Establishment.Year
## 1 0 Northern Delhi Delhi           India Gate War Memorial               1921
## 2 1 Northern Delhi Delhi       Humayun's Tomb         Tomb               1572
## 3 2 Northern Delhi Delhi    Akshardham Temple       Temple               2005
## 4 3 Northern Delhi Delhi Waste to Wonder Park   Theme Park               2019
## 5 4 Northern Delhi Delhi        Jantar Mantar  Observatory               1724
## 6 5 Northern Delhi Delhi        Chandni Chowk       Market               1700
##   time.needed.to.visit.in.hrs Google.review.rating Entrance.Fee.in.INR
## 1                         0.5                  4.6                   0
## 2                         2.0                  4.5                  30
## 3                         5.0                  4.6                  60
## 4                         2.0                  4.1                  50
## 5                         2.0                  4.2                  15
## 6                         3.0                  4.2                   0
##   Airport.with.50km.Radius Weekly.Off  Significance DSLR.Allowed
## 1                      Yes       None    Historical          Yes
## 2                      Yes       None    Historical          Yes
## 3                      Yes       None     Religious           No
## 4                      Yes     Monday Environmental          Yes
## 5                      Yes       None    Scientific          Yes
## 6                      Yes     Sunday        Market          Yes
##   Number.of.google.review.in.lakhs Best.Time.to.visit
## 1                             2.60            Evening
## 2                             0.40          Afternoon
## 3                             0.40          Afternoon
## 4                             0.27            Evening
## 5                             0.31            Morning
## 6                             0.25          Afternoon

##Verificamos la estrucutra de los datos

str(viajes)
## 'data.frame':    325 obs. of  16 variables:
##  $ X                               : int  0 1 2 3 4 5 6 7 8 9 ...
##  $ Zone                            : chr  "Northern" "Northern" "Northern" "Northern" ...
##  $ State                           : chr  "Delhi" "Delhi" "Delhi" "Delhi" ...
##  $ City                            : chr  "Delhi" "Delhi" "Delhi" "Delhi" ...
##  $ Name                            : chr  "India Gate" "Humayun's Tomb" "Akshardham Temple" "Waste to Wonder Park" ...
##  $ Type                            : chr  "War Memorial" "Tomb" "Temple" "Theme Park" ...
##  $ Establishment.Year              : chr  "1921" "1572" "2005" "2019" ...
##  $ time.needed.to.visit.in.hrs     : num  0.5 2 5 2 2 3 1 2 1 2 ...
##  $ Google.review.rating            : num  4.6 4.5 4.6 4.1 4.2 4.2 4.5 4.5 4.2 4.6 ...
##  $ Entrance.Fee.in.INR             : int  0 30 60 50 15 0 0 35 0 0 ...
##  $ Airport.with.50km.Radius        : chr  "Yes" "Yes" "Yes" "Yes" ...
##  $ Weekly.Off                      : chr  "None" "None" "None" "Monday" ...
##  $ Significance                    : chr  "Historical" "Historical" "Religious" "Environmental" ...
##  $ DSLR.Allowed                    : chr  "Yes" "Yes" "No" "Yes" ...
##  $ Number.of.google.review.in.lakhs: num  2.6 0.4 0.4 0.27 0.31 0.25 0.59 1.5 0.41 0.16 ...
##  $ Best.Time.to.visit              : chr  "Evening" "Afternoon" "Afternoon" "Evening" ...

##Verificamos las dimensiones de los datos

dim(viajes)
## [1] 325  16

##Nombres de las Variables

names(viajes)
##  [1] "X"                                "Zone"                            
##  [3] "State"                            "City"                            
##  [5] "Name"                             "Type"                            
##  [7] "Establishment.Year"               "time.needed.to.visit.in.hrs"     
##  [9] "Google.review.rating"             "Entrance.Fee.in.INR"             
## [11] "Airport.with.50km.Radius"         "Weekly.Off"                      
## [13] "Significance"                     "DSLR.Allowed"                    
## [15] "Number.of.google.review.in.lakhs" "Best.Time.to.visit"
names(viajes)[3]
## [1] "State"

##Seleccion de una fila

caso_fil1 <- viajes[ 3, ]
head(caso_fil1)
##   X     Zone State  City              Name   Type Establishment.Year
## 3 2 Northern Delhi Delhi Akshardham Temple Temple               2005
##   time.needed.to.visit.in.hrs Google.review.rating Entrance.Fee.in.INR
## 3                           5                  4.6                  60
##   Airport.with.50km.Radius Weekly.Off Significance DSLR.Allowed
## 3                      Yes       None    Religious           No
##   Number.of.google.review.in.lakhs Best.Time.to.visit
## 3                              0.4          Afternoon

##Seleccion de varias filas continuas

caso_fil2 <- viajes[ 1:10, ]
head(caso_fil2)
##   X     Zone State  City                 Name         Type Establishment.Year
## 1 0 Northern Delhi Delhi           India Gate War Memorial               1921
## 2 1 Northern Delhi Delhi       Humayun's Tomb         Tomb               1572
## 3 2 Northern Delhi Delhi    Akshardham Temple       Temple               2005
## 4 3 Northern Delhi Delhi Waste to Wonder Park   Theme Park               2019
## 5 4 Northern Delhi Delhi        Jantar Mantar  Observatory               1724
## 6 5 Northern Delhi Delhi        Chandni Chowk       Market               1700
##   time.needed.to.visit.in.hrs Google.review.rating Entrance.Fee.in.INR
## 1                         0.5                  4.6                   0
## 2                         2.0                  4.5                  30
## 3                         5.0                  4.6                  60
## 4                         2.0                  4.1                  50
## 5                         2.0                  4.2                  15
## 6                         3.0                  4.2                   0
##   Airport.with.50km.Radius Weekly.Off  Significance DSLR.Allowed
## 1                      Yes       None    Historical          Yes
## 2                      Yes       None    Historical          Yes
## 3                      Yes       None     Religious           No
## 4                      Yes     Monday Environmental          Yes
## 5                      Yes       None    Scientific          Yes
## 6                      Yes     Sunday        Market          Yes
##   Number.of.google.review.in.lakhs Best.Time.to.visit
## 1                             2.60            Evening
## 2                             0.40          Afternoon
## 3                             0.40          Afternoon
## 4                             0.27            Evening
## 5                             0.31            Morning
## 6                             0.25          Afternoon

##Seleccion de varias filas no continuas

caso_fil3 <- viajes[c(1,10,40:70), ]
head(caso_fil3)
##     X     Zone       State      City                  Name         Type
## 1   0 Northern       Delhi     Delhi            India Gate War Memorial
## 10  9 Northern       Delhi     Delhi        Sunder Nursery         Park
## 40 39 Southern   Telangana Hyderabad    Chowmahalla Palace       Palace
## 41 40 Southern   Telangana Hyderabad Nehru Zoological Park          Zoo
## 42 41 Southern   Telangana Hyderabad          Lumbini Park         Park
## 43 42  Eastern West Bengal   Kolkata     Victoria Memorial       Museum
##    Establishment.Year time.needed.to.visit.in.hrs Google.review.rating
## 1                1921                         0.5                  4.6
## 10               1600                         2.0                  4.6
## 40               1800                         1.5                  4.4
## 41               1963                         3.0                  4.2
## 42               1994                         1.0                  4.1
## 43               1921                         1.5                  4.6
##    Entrance.Fee.in.INR Airport.with.50km.Radius Weekly.Off Significance
## 1                    0                      Yes       None   Historical
## 10                   0                      Yes       None    Botanical
## 40                  80                      Yes       None   Historical
## 41                  50                      Yes       None     Wildlife
## 42                  20                      Yes       None Recreational
## 43                  30                      Yes     Monday   Historical
##    DSLR.Allowed Number.of.google.review.in.lakhs Best.Time.to.visit
## 1           Yes                             2.60            Evening
## 10          Yes                             0.16          Afternoon
## 40          Yes                             0.45            Morning
## 41          Yes                             0.86            Morning
## 42          Yes                             0.73            Evening
## 43          Yes                             0.73            Morning

##Seleccionar observaciones con alguna condición:

caso_fil4 <- viajes[viajes$Zone>=35, ]
head(caso_fil4)
##   X     Zone State  City                 Name         Type Establishment.Year
## 1 0 Northern Delhi Delhi           India Gate War Memorial               1921
## 2 1 Northern Delhi Delhi       Humayun's Tomb         Tomb               1572
## 3 2 Northern Delhi Delhi    Akshardham Temple       Temple               2005
## 4 3 Northern Delhi Delhi Waste to Wonder Park   Theme Park               2019
## 5 4 Northern Delhi Delhi        Jantar Mantar  Observatory               1724
## 6 5 Northern Delhi Delhi        Chandni Chowk       Market               1700
##   time.needed.to.visit.in.hrs Google.review.rating Entrance.Fee.in.INR
## 1                         0.5                  4.6                   0
## 2                         2.0                  4.5                  30
## 3                         5.0                  4.6                  60
## 4                         2.0                  4.1                  50
## 5                         2.0                  4.2                  15
## 6                         3.0                  4.2                   0
##   Airport.with.50km.Radius Weekly.Off  Significance DSLR.Allowed
## 1                      Yes       None    Historical          Yes
## 2                      Yes       None    Historical          Yes
## 3                      Yes       None     Religious           No
## 4                      Yes     Monday Environmental          Yes
## 5                      Yes       None    Scientific          Yes
## 6                      Yes     Sunday        Market          Yes
##   Number.of.google.review.in.lakhs Best.Time.to.visit
## 1                             2.60            Evening
## 2                             0.40          Afternoon
## 3                             0.40          Afternoon
## 4                             0.27            Evening
## 5                             0.31            Morning
## 6                             0.25          Afternoon

#Tablas de frecuencias (Para cada variable)

##Tabla de frecuencia de manera manual

table <-(viajes$Google.review.rating)

##Guardando la Tabla en Ta

ta <- table(viajes$Google.review.rating)

##Obtenemos las proporciones

ta<-prop.table(table(viajes$Google.review.rating))
# presentamos los resultados
ta
## 
##         1.4         3.7         3.8         3.9           4         4.1 
## 0.003076923 0.003076923 0.009230769 0.018461538 0.003076923 0.046153846 
##         4.2         4.3         4.4         4.5         4.6         4.7 
## 0.046153846 0.052307692 0.169230769 0.215384615 0.196923077 0.147692308 
##         4.8         4.9 
## 0.080000000 0.009230769

##Generar una tabla de frecuencia de manera manual

table(viajes$Google.review.rating)
## 
## 1.4 3.7 3.8 3.9   4 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 
##   1   1   3   6   1  15  15  17  55  70  64  48  26   3

##Guardamos la tabla en fi

fi<-table(viajes$Google.review.rating)
#Mostramos
fi
## 
## 1.4 3.7 3.8 3.9   4 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 
##   1   1   3   6   1  15  15  17  55  70  64  48  26   3

##Obtenemos las proporciones

hi<-prop.table(table(viajes$Google.review.rating))
#Mostramos
hi
## 
##         1.4         3.7         3.8         3.9           4         4.1 
## 0.003076923 0.003076923 0.009230769 0.018461538 0.003076923 0.046153846 
##         4.2         4.3         4.4         4.5         4.6         4.7 
## 0.046153846 0.052307692 0.169230769 0.215384615 0.196923077 0.147692308 
##         4.8         4.9 
## 0.080000000 0.009230769

##Calculamos frecuencias porcentuales

# Redondeamos a dos decimales
hi<-round(hi,2)
# Calculamos los porcentajes
pi<-prop.table(table(viajes$Google.review.rating))*100
#Mostramos
pi
## 
##        1.4        3.7        3.8        3.9          4        4.1        4.2 
##  0.3076923  0.3076923  0.9230769  1.8461538  0.3076923  4.6153846  4.6153846 
##        4.3        4.4        4.5        4.6        4.7        4.8        4.9 
##  5.2307692 16.9230769 21.5384615 19.6923077 14.7692308  8.0000000  0.9230769

##Unimos los resultados en una sola tabla

tabla1 <-t(rbind(fi,hi,pi))
tabla1
##     fi   hi         pi
## 1.4  1 0.00  0.3076923
## 3.7  1 0.00  0.3076923
## 3.8  3 0.01  0.9230769
## 3.9  6 0.02  1.8461538
## 4    1 0.00  0.3076923
## 4.1 15 0.05  4.6153846
## 4.2 15 0.05  4.6153846
## 4.3 17 0.05  5.2307692
## 4.4 55 0.17 16.9230769
## 4.5 70 0.22 21.5384615
## 4.6 64 0.20 19.6923077
## 4.7 48 0.15 14.7692308
## 4.8 26 0.08  8.0000000
## 4.9  3 0.01  0.9230769

##Utilizando librerias para generar las tablas de frecuencia Utilizando librería summarytools

# Cargamos la librería
library(summarytools)
## Warning: package 'summarytools' was built under R version 4.3.2
# función freq permite generar la tabla de frecuencia
freq(viajes$Google.review.rating, report.nas = FALSE)
## Frequencies  
## viajes$Google.review.rating  
## Type: Numeric  
## 
##               Freq        %   % Cum.
## ----------- ------ -------- --------
##         1.4      1     0.31     0.31
##         3.7      1     0.31     0.62
##         3.8      3     0.92     1.54
##         3.9      6     1.85     3.38
##           4      1     0.31     3.69
##         4.1     15     4.62     8.31
##         4.2     15     4.62    12.92
##         4.3     17     5.23    18.15
##         4.4     55    16.92    35.08
##         4.5     70    21.54    56.62
##         4.6     64    19.69    76.31
##         4.7     48    14.77    91.08
##         4.8     26     8.00    99.08
##         4.9      3     0.92   100.00
##       Total    325   100.00   100.00

##Utilizando librería epiDisplay

# Cargamos la librería
library(epiDisplay)
## Warning: package 'epiDisplay' was built under R version 4.3.2
## Loading required package: foreign
## Loading required package: survival
## Loading required package: MASS
## Loading required package: nnet
tab1(viajes$Google.review.rating, graph =FALSE)
## viajes$Google.review.rating : 
##         Frequency Percent Cum. percent
## 1.4             1     0.3          0.3
## 3.7             1     0.3          0.6
## 3.8             3     0.9          1.5
## 3.9             6     1.8          3.4
## 4               1     0.3          3.7
## 4.1            15     4.6          8.3
## 4.2            15     4.6         12.9
## 4.3            17     5.2         18.2
## 4.4            55    16.9         35.1
## 4.5            70    21.5         56.6
## 4.6            64    19.7         76.3
## 4.7            48    14.8         91.1
## 4.8            26     8.0         99.1
## 4.9             3     0.9        100.0
##   Total       325   100.0        100.0

##Tablas de frecuencia para variables cuantitativas discretas ##Utilizando librería summarytools

# Cargamos la librería
library(summarytools)
# función freq permite generar la tabla de frecuencia
freq(viajes$Entrance.Fee.in.INR, report.nas = FALSE)
## Frequencies  
## viajes$Entrance.Fee.in.INR  
## Type: Integer  
## 
##               Freq        %   % Cum.
## ----------- ------ -------- --------
##           0    183    56.31    56.31
##           5      1     0.31    56.62
##          10     12     3.69    60.31
##          15      5     1.54    61.85
##          20     19     5.85    67.69
##          25      6     1.85    69.54
##          30     13     4.00    73.54
##          35      4     1.23    74.77
##          40      7     2.15    76.92
##          50     21     6.46    83.38
##          60      4     1.23    84.62
##          65      1     0.31    84.92
##          70      1     0.31    85.23
##          75      1     0.31    85.54
##          80      2     0.62    86.15
##         100      8     2.46    88.62
##         150      4     1.23    89.85
##         200      4     1.23    91.08
##         250      2     0.62    91.69
##         300      5     1.54    93.23
##         350      1     0.31    93.54
##         500      7     2.15    95.69
##         550      1     0.31    96.00
##         650      1     0.31    96.31
##         750      1     0.31    96.62
##         890      1     0.31    96.92
##        1100      1     0.31    97.23
##        1149      2     0.62    97.85
##        1150      1     0.31    98.15
##        1500      2     0.62    98.77
##        2500      2     0.62    99.38
##        3500      1     0.31    99.69
##        7500      1     0.31   100.00
##       Total    325   100.00   100.00

##Utilizando librería epiDisplay ##Cargamos la librería

library(epiDisplay)
tab1(viajes$Entrance.Fee.in.INR, graph =FALSE)
## viajes$Entrance.Fee.in.INR : 
##         Frequency Percent Cum. percent
## 0             183    56.3         56.3
## 5               1     0.3         56.6
## 10             12     3.7         60.3
## 15              5     1.5         61.8
## 20             19     5.8         67.7
## 25              6     1.8         69.5
## 30             13     4.0         73.5
## 35              4     1.2         74.8
## 40              7     2.2         76.9
## 50             21     6.5         83.4
## 60              4     1.2         84.6
## 65              1     0.3         84.9
## 70              1     0.3         85.2
## 75              1     0.3         85.5
## 80              2     0.6         86.2
## 100             8     2.5         88.6
## 150             4     1.2         89.8
## 200             4     1.2         91.1
## 250             2     0.6         91.7
## 300             5     1.5         93.2
## 350             1     0.3         93.5
## 500             7     2.2         95.7
## 550             1     0.3         96.0
## 650             1     0.3         96.3
## 750             1     0.3         96.6
## 890             1     0.3         96.9
## 1100            1     0.3         97.2
## 1149            2     0.6         97.8
## 1150            1     0.3         98.2
## 1500            2     0.6         98.8
## 2500            2     0.6         99.4
## 3500            1     0.3         99.7
## 7500            1     0.3        100.0
##   Total       325   100.0        100.0

#VI. Representación gráfica de datos.

##Verificamos la estructura de los datos

str(viajes)
## 'data.frame':    325 obs. of  16 variables:
##  $ X                               : int  0 1 2 3 4 5 6 7 8 9 ...
##  $ Zone                            : chr  "Northern" "Northern" "Northern" "Northern" ...
##  $ State                           : chr  "Delhi" "Delhi" "Delhi" "Delhi" ...
##  $ City                            : chr  "Delhi" "Delhi" "Delhi" "Delhi" ...
##  $ Name                            : chr  "India Gate" "Humayun's Tomb" "Akshardham Temple" "Waste to Wonder Park" ...
##  $ Type                            : chr  "War Memorial" "Tomb" "Temple" "Theme Park" ...
##  $ Establishment.Year              : chr  "1921" "1572" "2005" "2019" ...
##  $ time.needed.to.visit.in.hrs     : num  0.5 2 5 2 2 3 1 2 1 2 ...
##  $ Google.review.rating            : num  4.6 4.5 4.6 4.1 4.2 4.2 4.5 4.5 4.2 4.6 ...
##  $ Entrance.Fee.in.INR             : int  0 30 60 50 15 0 0 35 0 0 ...
##  $ Airport.with.50km.Radius        : chr  "Yes" "Yes" "Yes" "Yes" ...
##  $ Weekly.Off                      : chr  "None" "None" "None" "Monday" ...
##  $ Significance                    : chr  "Historical" "Historical" "Religious" "Environmental" ...
##  $ DSLR.Allowed                    : chr  "Yes" "Yes" "No" "Yes" ...
##  $ Number.of.google.review.in.lakhs: num  2.6 0.4 0.4 0.27 0.31 0.25 0.59 1.5 0.41 0.16 ...
##  $ Best.Time.to.visit              : chr  "Evening" "Afternoon" "Afternoon" "Evening" ...

A.Gráficos de variables cualitativas

plot(viajes$Google.review.rating)

##Mejoramos el gráfico adicionando titulo y nombres en los ejes

barplot(table(viajes$Google.review.rating), main="Revisión promedio de Google", 
        xlab="Revision",
        ylab="Viajes")