UNIVERSIDAD CENTRAL DEL ECUADOR

PROYECTO:ESTUDIO ESTADÍSTICO DE LA CALIDAD DEL AIRE EN INDIA

FECHA: 22/11/2025

#Estadística Descriptiva
#Ariana Viteri
#19/11/2025

library(gt)
library(dplyr)

#Cargar los datos 

datos<-read.csv("~/ariana tercer semestre/Estadistica/city_day.csv",header = TRUE,dec = ".",sep = ",")

#Tablas Cualitativas Nominales

#StationName
StationName<- datos$StationName
#Tabla de distribución de frecuencia
TDF_StationName<- data.frame(table(StationName))
ni <- TDF_StationName$Freq
hi <- round((ni / sum(ni)) *100,2)
StationName <- TDF_StationName$StationName
TDF_StationName <- data.frame(StationName,ni,hi)
Summary <- data.frame(StationName = "TOTAL", ni=sum(ni), hi = 100)

TDF_StationName_suma <- rbind(TDF_StationName,Summary)

colnames(TDF_StationName_suma) <- c("Nombre_Oficial", "ni", "hi(%)")

# TABLA 

TDF_StationName_suma %>%
  gt() %>%
  tab_header(
    title = md("Tabla Nro. 3"),
    subtitle = md("*Tabla de distribución de frecuencias del Nombre oficial de la estación de monitoreo*")
  ) %>%
  tab_source_note(
    source_note = md("Fuente: Datos procesados por el autor a partir de archivo city.day.csv ")
  ) %>%
  tab_style(
    style = cell_borders(
      sides = "left",
      color = "black",
      weight = px(2),
      style = "solid"
    ),
    locations = cells_body()
  ) %>%
  tab_style(
    style = cell_borders(
      sides = "right",
      color = "black",
      weight = px(2),
      style = "solid"
    ),
    locations = cells_body()
  ) %>%
  tab_style(
    style = cell_borders(
      sides = "left",
      color = "black",
      weight = px(2),
      style = "solid"
    ),
    locations = cells_column_labels()
  ) %>%
  tab_style(
    style = cell_borders(
      sides = "right",
      color = "black",
      weight = px(2),
      style = "solid"
    ),
    locations = cells_column_labels()
  )%>%
  tab_options(
    table.border.top.color = "black",
    table.border.bottom.color = "black",
    table.border.top.style = "solid",
    table.border.bottom.style = "solid",
    column_labels.border.top.color = "black",
    column_labels.border.bottom.color = "black",
    column_labels.border.bottom.width = px(2),
    row.striping.include_table_body = TRUE,
    heading.border.bottom.color = "black",
    heading.border.bottom.width = px(2),
    table_body.hlines.color = "gray",
    table_body.border.bottom.color = "black"
  )
Tabla Nro. 3
Tabla de distribución de frecuencias del Nombre oficial de la estación de monitoreo
Nombre_Oficial ni hi(%)
Adarsh Nagar, Jaipur - RSPCB 1114 3.77
Alandur Bus Depot, Chennai - CPCB 2009 6.80
Alipur, Delhi - DPCC 2009 6.80
Ballygunge, Kolkata - WBPCB 814 2.76
Bandra, Mumbai - MPCB 2009 6.80
Bollaram Industrial Area, Hyderabad - TSPCB 2006 6.79
BTM Layout, Bengaluru - CPCB 2009 6.80
Central School, Lucknow - CPCB 2009 6.80
DRM Office Danapur, Patna - BSPCB 1858 6.29
GM Office, Brajrajnagar - OSPCB 938 3.18
Golden Temple, Amritsar - PPCB 1221 4.13
GVM Corporation, Visakhapatnam - APPCB 1462 4.95
Kacheripady, Ernakulam - Kerala PCB 162 0.55
Kariavattom, Thiruvananthapuram - Kerala PCB 1112 3.77
Lumpyngngad, Shillong - Meghalaya PCB 310 1.05
Maninagar, Ahmedabad - GPCB 2009 6.80
NISE Gwal Pahari, Gurugram - IMD 1679 5.69
Railway Colony, Guwahati - APCB 502 1.70
Secretariat, Amaravati - APPCB 951 3.22
Sector-25, Chandigarh - CPCC 304 1.03
SIDCO Kurichi, Coimbatore - TNPCB 386 1.31
Sikulpuikawn, Aizawl - Mizoram PCB 113 0.38
T T Nagar, Bhopal - MPPCB 289 0.98
Talcher Coalfields,Talcher - OSPCB 925 3.13
Tata Stadium, Jorapokhar - JSPCB 1169 3.96
Vyttila, Kochi - Kerala PCB 162 0.55
TOTAL 29531 100.00
Fuente: Datos procesados por el autor a partir de archivo city.day.csv