Trabalho Biostatística

Author

Ana Prya Bartolo Gomes, Bruna Lacerda, Felipe Almada, Ismael de Jesus, Luiz Daniel Gonzalez de Sena, Michaelle Nery

##Lendo e vizualizando o arquivo do excel

library(readxl)
world_data_2023 <- read_excel("trabalho bioestatistica_files/world-data-2023.xlsx", 
    col_types = c("text", "text", "numeric", 
        "text", "text", "text", "numeric", 
        "text", "text", "numeric", "numeric", 
        "text", "text", "text", "text", "text", 
        "text", "text", "numeric"))
View(world_data_2023)

##Atribuindo o arquivo à dados e fazendo a tabela dos dados

library(gtsummary)
dados<-(world_data_2023)
tbl_summary(dados)
Characteristic N = 361
País
    Afghanistan 1 (2.8%)
    Angola 1 (2.8%)
    Argentina 1 (2.8%)
    Brazil 1 (2.8%)
    Cambodia 1 (2.8%)
    Canada 1 (2.8%)
    China 1 (2.8%)
    Djibouti 1 (2.8%)
    Egypt 1 (2.8%)
    El Salvador 1 (2.8%)
    Ethiopia 1 (2.8%)
    France 1 (2.8%)
    Germany 1 (2.8%)
    India 1 (2.8%)
    Iran 1 (2.8%)
    Italy 1 (2.8%)
    Japan 1 (2.8%)
    Liechtenstein 1 (2.8%)
    Madagascar 1 (2.8%)
    Mexico 1 (2.8%)
    Mongolia 1 (2.8%)
    Nigeria 1 (2.8%)
    Republic of the Congo 1 (2.8%)
    Russia 1 (2.8%)
    Saudi Arabia 1 (2.8%)
    Senegal 1 (2.8%)
    Slovakia 1 (2.8%)
    South Africa 1 (2.8%)
    Suriname 1 (2.8%)
    Turkey 1 (2.8%)
    United Arab Emirates 1 (2.8%)
    United Kingdom 1 (2.8%)
    United States 1 (2.8%)
    Uruguay 1 (2.8%)
    Venezuela 1 (2.8%)
    Zimbabwe 1 (2.8%)
Taxa Total de Imposto (%)
    106.30 1 (2.8%)
    15.70 1 (2.8%)
    15.90 1 (2.8%)
    21.60 1 (2.8%)
    23.10 1 (2.8%)
    24.50 1 (2.8%)
    25.70 1 (2.8%)
    27.90 1 (2.8%)
    29.20 1 (2.8%)
    30.60 1 (2.8%)
    31.60 1 (2.8%)
    34.80 1 (2.8%)
    36.40 1 (2.8%)
    36.60 1 (2.8%)
    37.70 1 (2.8%)
    37.90 1 (2.8%)
    38.30 1 (2.8%)
    41.80 1 (2.8%)
    42.30 1 (2.8%)
    44.40 1 (2.8%)
    44.70 1 (2.8%)
    44.80 1 (2.8%)
    46.20 1 (2.8%)
    46.70 1 (2.8%)
    48.80 1 (2.8%)
    49.10 1 (2.8%)
    49.70 2 (5.6%)
    54.30 1 (2.8%)
    55.10 1 (2.8%)
    59.10 1 (2.8%)
    59.20 1 (2.8%)
    60.70 1 (2.8%)
    65.10 1 (2.8%)
    71.40 1 (2.8%)
    73.30 1 (2.8%)
Densidade (P/Km2)" 63 (26, 128)
Terras Agrícolas(%)
    0.60 1 (2.8%)
    12.30 1 (2.8%)
    13.30 1 (2.8%)
    24.50 1 (2.8%)
    28.20 1 (2.8%)
    3.80 1 (2.8%)
    30.90 1 (2.8%)
    31.10 1 (2.8%)
    32.20 1 (2.8%)
    33.90 1 (2.8%)
    36.30 1 (2.8%)
    39.20 1 (2.8%)
    41.90 1 (2.8%)
    43.20 1 (2.8%)
    44.40 1 (2.8%)
    46.10 1 (2.8%)
    47.50 1 (2.8%)
    47.70 1 (2.8%)
    49.80 1 (2.8%)
    5.50 1 (2.8%)
    52.40 1 (2.8%)
    54.30 1 (2.8%)
    54.60 1 (2.8%)
    56.20 1 (2.8%)
    58.10 1 (2.8%)
    6.90 1 (2.8%)
    60.40 1 (2.8%)
    71.20 1 (2.8%)
    71.50 1 (2.8%)
    71.70 1 (2.8%)
    73.40 1 (2.8%)
    76.40 1 (2.8%)
    77.70 1 (2.8%)
    79.80 1 (2.8%)
    80.80 1 (2.8%)
    82.60 1 (2.8%)
Land Area(Km2)
    1001450 1 (2.8%)
    1104300 1 (2.8%)
    1219090 1 (2.8%)
    1246700 1 (2.8%)
    1564116 1 (2.8%)
    160 1 (2.8%)
    163.82 1 (2.8%)
    1648195 1 (2.8%)
    17098240 1 (2.8%)
    176215 1 (2.8%)
    181035 1 (2.8%)
    1964375 1 (2.8%)
    196722 1 (2.8%)
    21041 1 (2.8%)
    2149690 1 (2.8%)
    23.2 1 (2.8%)
    243.61 1 (2.8%)
    2780400 1 (2.8%)
    301.34 1 (2.8%)
    3287263 1 (2.8%)
    342 1 (2.8%)
    357022 1 (2.8%)
    377944 1 (2.8%)
    390757 1 (2.8%)
    49035 1 (2.8%)
    587041 1 (2.8%)
    643801 1 (2.8%)
    652.23 1 (2.8%)
    783562 1 (2.8%)
    83.6 1 (2.8%)
    8515770 1 (2.8%)
    912.05 1 (2.8%)
    923768 1 (2.8%)
    9596960 1 (2.8%)
    9833517 1 (2.8%)
    9984670 1 (2.8%)
Taxa de Natalidade
    10.1 1 (2.8%)
    10.33 1 (2.8%)
    10.6 1 (2.8%)
    10.9 1 (2.8%)
    11 1 (2.8%)
    11.3 1 (2.8%)
    11.5 1 (2.8%)
    11.6 1 (2.8%)
    13.86 1 (2.8%)
    13.92 1 (2.8%)
    16.03 1 (2.8%)
    17.02 1 (2.8%)
    17.6 1 (2.8%)
    17.8 1 (2.8%)
    17.86 1 (2.8%)
    17.88 1 (2.8%)
    18.25 1 (2.8%)
    18.54 1 (2.8%)
    18.78 1 (2.8%)
    20.51 1 (2.8%)
    21.47 1 (2.8%)
    22.46 1 (2.8%)
    24.13 1 (2.8%)
    26.38 1 (2.8%)
    30.68 1 (2.8%)
    32.34 1 (2.8%)
    32.49 1 (2.8%)
    32.66 1 (2.8%)
    32.86 1 (2.8%)
    34.52 1 (2.8%)
    37.91 1 (2.8%)
    40.73 1 (2.8%)
    7.3 1 (2.8%)
    7.4 1 (2.8%)
    9.5 1 (2.8%)
    9.9 1 (2.8%)
Emissão de Co2 142,272 (7,068, 479,085)
Taxa de Fertilidade
    1.29 1 (2.8%)
    1.41 1 (2.8%)
    1.42 1 (2.8%)
    1.44 1 (2.8%)
    1.5 1 (2.8%)
    1.52 1 (2.8%)
    1.56 1 (2.8%)
    1.57 1 (2.8%)
    1.68 1 (2.8%)
    1.69 1 (2.8%)
    1.73 2 (5.6%)
    1.88 1 (2.8%)
    1.97 1 (2.8%)
    2.04 1 (2.8%)
    2.07 1 (2.8%)
    2.13 1 (2.8%)
    2.14 1 (2.8%)
    2.22 1 (2.8%)
    2.26 1 (2.8%)
    2.27 1 (2.8%)
    2.32 1 (2.8%)
    2.41 1 (2.8%)
    2.42 1 (2.8%)
    2.5 1 (2.8%)
    2.73 1 (2.8%)
    2.9 1 (2.8%)
    3.33 1 (2.8%)
    3.62 1 (2.8%)
    4.08 1 (2.8%)
    4.25 1 (2.8%)
    4.43 1 (2.8%)
    4.47 1 (2.8%)
    4.63 1 (2.8%)
    5.39 1 (2.8%)
    5.52 1 (2.8%)
Area Florestal(%)
    0.10 1 (2.8%)
    0.20 1 (2.8%)
    0.50 1 (2.8%)
    10.70 1 (2.8%)
    12.50 1 (2.8%)
    12.60 1 (2.8%)
    13.10 1 (2.8%)
    15.40 1 (2.8%)
    2.10 1 (2.8%)
    21.40 1 (2.8%)
    22.40 1 (2.8%)
    23.80 1 (2.8%)
    31.20 1 (2.8%)
    31.80 1 (2.8%)
    32.70 1 (2.8%)
    33.90 2 (5.6%)
    35.50 1 (2.8%)
    38.20 1 (2.8%)
    4.60 1 (2.8%)
    40.40 1 (2.8%)
    42.80 1 (2.8%)
    43.10 1 (2.8%)
    46.30 1 (2.8%)
    49.80 1 (2.8%)
    52.70 1 (2.8%)
    52.90 1 (2.8%)
    58.90 1 (2.8%)
    6.60 1 (2.8%)
    65.40 1 (2.8%)
    68.50 1 (2.8%)
    7.20 1 (2.8%)
    7.60 1 (2.8%)
    8.00 1 (2.8%)
    9.80 1 (2.8%)
    98.30 1 (2.8%)
PIB ($) 433,243,775,031 (26,161,501,013, 1,762,258,732,332)
Matrícula Bruta no Ensino Primário (%) 103 (100, 108)
Expectativa de Vida
    54.3 1 (2.8%)
    60.8 1 (2.8%)
    61.2 1 (2.8%)
    63.9 1 (2.8%)
    64.3 1 (2.8%)
    64.5 1 (2.8%)
    66.2 1 (2.8%)
    66.6 1 (2.8%)
    66.7 1 (2.8%)
    67.7 1 (2.8%)
    69.4 1 (2.8%)
    69.6 1 (2.8%)
    69.7 1 (2.8%)
    71.6 1 (2.8%)
    71.8 1 (2.8%)
    72.1 1 (2.8%)
    72.7 1 (2.8%)
    73.1 1 (2.8%)
    75 2 (5.6%)
    75.7 1 (2.8%)
    76.5 2 (5.6%)
    77 1 (2.8%)
    77.2 1 (2.8%)
    77.4 1 (2.8%)
    77.8 2 (5.6%)
    78.5 1 (2.8%)
    80.9 1 (2.8%)
    81.3 1 (2.8%)
    81.9 1 (2.8%)
    82.5 1 (2.8%)
    82.9 1 (2.8%)
    83 1 (2.8%)
    84.2 1 (2.8%)
Salário Mínimo
    0.01 1 (3.8%)
    0.21 1 (3.8%)
    0.30 1 (3.8%)
    0.31 1 (3.8%)
    0.43 1 (3.8%)
    0.49 1 (3.8%)
    0.50 1 (3.8%)
    0.53 1 (3.8%)
    0.54 1 (3.8%)
    0.65 1 (3.8%)
    0.71 1 (3.8%)
    0.87 1 (3.8%)
    0.88 1 (3.8%)
    1.53 1 (3.8%)
    1.58 1 (3.8%)
    1.66 1 (3.8%)
    10.13 1 (3.8%)
    11.16 1 (3.8%)
    3.11 1 (3.8%)
    3.35 1 (3.8%)
    3.45 1 (3.8%)
    3.85 1 (3.8%)
    6.77 1 (3.8%)
    7.25 1 (3.8%)
    9.51 1 (3.8%)
    9.99 1 (3.8%)
    Unknown 10
Despesas de Saúde do Próprio Bolso
    10.10 1 (2.9%)
    11.10 1 (2.9%)
    12.50 1 (2.9%)
    13.10 1 (2.9%)
    14.60 1 (2.9%)
    14.80 1 (2.9%)
    15.00 1 (2.9%)
    16.20 1 (2.9%)
    16.90 1 (2.9%)
    17.60 1 (2.9%)
    17.80 1 (2.9%)
    18.40 1 (2.9%)
    20.40 1 (2.9%)
    21.70 1 (2.9%)
    22.80 1 (2.9%)
    25.80 1 (2.9%)
    27.90 1 (2.9%)
    28.30 1 (2.9%)
    32.40 1 (2.9%)
    33.40 1 (2.9%)
    36.40 1 (2.9%)
    37.80 1 (2.9%)
    39.30 1 (2.9%)
    39.70 1 (2.9%)
    41.40 1 (2.9%)
    43.80 1 (2.9%)
    44.20 1 (2.9%)
    45.80 1 (2.9%)
    59.40 1 (2.9%)
    6.80 1 (2.9%)
    62.00 1 (2.9%)
    65.10 1 (2.9%)
    7.70 1 (2.9%)
    72.20 1 (2.9%)
    78.40 1 (2.9%)
    Unknown 1
População
    100388073 1 (2.8%)
    112078730 1 (2.8%)
    126014024 1 (2.8%)
    126226568 1 (2.8%)
    1366417754 1 (2.8%)
    1397715000 1 (2.8%)
    144373535 1 (2.8%)
    14645468 1 (2.8%)
    16296364 1 (2.8%)
    16486542 1 (2.8%)
    200963599 1 (2.8%)
    212559417 1 (2.8%)
    26969307 1 (2.8%)
    28515829 1 (2.8%)
    31825295 1 (2.8%)
    3225167 1 (2.8%)
    328239523 1 (2.8%)
    34268528 1 (2.8%)
    3461734 1 (2.8%)
    36991981 1 (2.8%)
    38019 1 (2.8%)
    38041754 1 (2.8%)
    44938712 1 (2.8%)
    5380508 1 (2.8%)
    5454073 1 (2.8%)
    581372 1 (2.8%)
    58558270 1 (2.8%)
    60297396 1 (2.8%)
    6453553 1 (2.8%)
    66834405 1 (2.8%)
    67059887 1 (2.8%)
    82913906 1 (2.8%)
    83132799 1 (2.8%)
    83429615 1 (2.8%)
    973.56 1 (2.8%)
    9770529 1 (2.8%)
Taxa de Desemprego
    0.68 1 (2.9%)
    1.76 1 (2.9%)
    10.30 1 (2.9%)
    10.76 1 (2.9%)
    11.12 1 (2.9%)
    11.38 1 (2.9%)
    12.08 1 (2.9%)
    13.49 1 (2.9%)
    14.70 1 (2.9%)
    2.08 1 (2.9%)
    2.29 1 (2.9%)
    2.35 1 (2.9%)
    28.18 1 (2.9%)
    3.04 1 (2.9%)
    3.42 1 (2.9%)
    3.85 1 (2.9%)
    4.11 1 (2.9%)
    4.32 1 (2.9%)
    4.59 1 (2.9%)
    4.95 1 (2.9%)
    5.36 1 (2.9%)
    5.56 2 (5.7%)
    5.93 1 (2.9%)
    6.01 1 (2.9%)
    6.60 1 (2.9%)
    6.89 1 (2.9%)
    7.33 1 (2.9%)
    8.10 1 (2.9%)
    8.43 1 (2.9%)
    8.73 1 (2.9%)
    8.80 1 (2.9%)
    9.47 1 (2.9%)
    9.79 1 (2.9%)
    9.89 1 (2.9%)
    Unknown 1
População Urbana
    10210849 1 (2.8%)
    102626859 1 (2.8%)
    102806948 1 (2.8%)
    107683889 1 (2.8%)
    115782416 1 (2.8%)
    183241641 1 (2.8%)
    21061025 1 (2.8%)
    2210626 1 (2.8%)
    23788710 1 (2.8%)
    25162368 1 (2.8%)
    270663028 1 (2.8%)
    28807838 1 (2.8%)
    2930419 1 (2.8%)
    30628482 1 (2.8%)
    3303394 1 (2.8%)
    3625010 1 (2.8%)
    384258 1 (2.8%)
    39149717 1 (2.8%)
    3924621 1 (2.8%)
    41339571 1 (2.8%)
    42651966 1 (2.8%)
    42895824 1 (2.8%)
    4694702 1 (2.8%)
    471031528 1 (2.8%)
    4717305 1 (2.8%)
    54123364 1 (2.8%)
    5464 1 (2.8%)
    55908316 1 (2.8%)
    62509623 1 (2.8%)
    63097818 1 (2.8%)
    64324835 1 (2.8%)
    758549 1 (2.8%)
    7765706 1 (2.8%)
    842933962 1 (2.8%)
    8479744 1 (2.8%)
    9797273 1 (2.8%)
Gross primary education enrollment (%)
    100.20 1 (2.8%)
    100.90 2 (5.6%)
    101.00 1 (2.8%)
    101.20 1 (2.8%)
    101.80 1 (2.8%)
    101.90 1 (2.8%)
    102.50 1 (2.8%)
    102.60 1 (2.8%)
    104.00 3 (8.3%)
    104.70 1 (2.8%)
    105.80 1 (2.8%)
    106.30 1 (2.8%)
    106.60 1 (2.8%)
    107.40 1 (2.8%)
    108.40 1 (2.8%)
    108.50 1 (2.8%)
    108.80 1 (2.8%)
    109.70 1 (2.8%)
    109.90 1 (2.8%)
    110.70 1 (2.8%)
    113.00 1 (2.8%)
    113.50 1 (2.8%)
    115.40 1 (2.8%)
    142.50 1 (2.8%)
    75.30 1 (2.8%)
    81.00 1 (2.8%)
    84.70 1 (2.8%)
    93.20 1 (2.8%)
    94.80 1 (2.8%)
    97.20 1 (2.8%)
    98.70 1 (2.8%)
    98.80 1 (2.8%)
    99.80 1 (2.8%)
Infant mortality 12 (6, 31)
    Unknown 1
1 n (%); Median (IQR)

##Apagando variáveis em excesso

library(dados)
dados<- world_data_2023
dados$Latitude<-NULL
dados$Longitude<-NULL
dados$`Tax revenue (%)`<-NULL
dados$`Physicians per thousand`<-NULL
dados$`Armed Forces size`<-NULL
dados$`Capital/Major City`<-NULL
dados$`Currency-Code`<-NULL
dados$`Gasoline Price`<-NULL
dados$`Official language`<-NULL
dados$`Calling Code`<-NULL #não sei o que é isso
dados$`<-`<-NULL #não sei o que é isso
dados$`Gross tertiary education enrollment (%)`<- NULL
dados$`Maternal mortality ratio`<- NULL
dados$CPI<- NULL
dados$`CPI Change (%)`<-NULL
dados$`Largest city`<- NULL
dados$`Terras Agrícolas(%)`<-NULL
dados$`Land Area(Km2)`<-NULL
dados$População<-NULL
dados$`População Urbana`<-NULL
dados$`Taxa de Desemprego`<-NULL
dados$`Densidade (P/Km2)"`<-NULL
dados$`Taxa de Natalidade`<-NULL

#Fazendo uma nova tabela, agora sem as variáveis em excesso

library(gtsummary)
dados<-(dados)
tbl_summary(dados)
Characteristic N = 361
País
    Afghanistan 1 (2.8%)
    Angola 1 (2.8%)
    Argentina 1 (2.8%)
    Brazil 1 (2.8%)
    Cambodia 1 (2.8%)
    Canada 1 (2.8%)
    China 1 (2.8%)
    Djibouti 1 (2.8%)
    Egypt 1 (2.8%)
    El Salvador 1 (2.8%)
    Ethiopia 1 (2.8%)
    France 1 (2.8%)
    Germany 1 (2.8%)
    India 1 (2.8%)
    Iran 1 (2.8%)
    Italy 1 (2.8%)
    Japan 1 (2.8%)
    Liechtenstein 1 (2.8%)
    Madagascar 1 (2.8%)
    Mexico 1 (2.8%)
    Mongolia 1 (2.8%)
    Nigeria 1 (2.8%)
    Republic of the Congo 1 (2.8%)
    Russia 1 (2.8%)
    Saudi Arabia 1 (2.8%)
    Senegal 1 (2.8%)
    Slovakia 1 (2.8%)
    South Africa 1 (2.8%)
    Suriname 1 (2.8%)
    Turkey 1 (2.8%)
    United Arab Emirates 1 (2.8%)
    United Kingdom 1 (2.8%)
    United States 1 (2.8%)
    Uruguay 1 (2.8%)
    Venezuela 1 (2.8%)
    Zimbabwe 1 (2.8%)
Taxa Total de Imposto (%)
    106.30 1 (2.8%)
    15.70 1 (2.8%)
    15.90 1 (2.8%)
    21.60 1 (2.8%)
    23.10 1 (2.8%)
    24.50 1 (2.8%)
    25.70 1 (2.8%)
    27.90 1 (2.8%)
    29.20 1 (2.8%)
    30.60 1 (2.8%)
    31.60 1 (2.8%)
    34.80 1 (2.8%)
    36.40 1 (2.8%)
    36.60 1 (2.8%)
    37.70 1 (2.8%)
    37.90 1 (2.8%)
    38.30 1 (2.8%)
    41.80 1 (2.8%)
    42.30 1 (2.8%)
    44.40 1 (2.8%)
    44.70 1 (2.8%)
    44.80 1 (2.8%)
    46.20 1 (2.8%)
    46.70 1 (2.8%)
    48.80 1 (2.8%)
    49.10 1 (2.8%)
    49.70 2 (5.6%)
    54.30 1 (2.8%)
    55.10 1 (2.8%)
    59.10 1 (2.8%)
    59.20 1 (2.8%)
    60.70 1 (2.8%)
    65.10 1 (2.8%)
    71.40 1 (2.8%)
    73.30 1 (2.8%)
Emissão de Co2 142,272 (7,068, 479,085)
Taxa de Fertilidade
    1.29 1 (2.8%)
    1.41 1 (2.8%)
    1.42 1 (2.8%)
    1.44 1 (2.8%)
    1.5 1 (2.8%)
    1.52 1 (2.8%)
    1.56 1 (2.8%)
    1.57 1 (2.8%)
    1.68 1 (2.8%)
    1.69 1 (2.8%)
    1.73 2 (5.6%)
    1.88 1 (2.8%)
    1.97 1 (2.8%)
    2.04 1 (2.8%)
    2.07 1 (2.8%)
    2.13 1 (2.8%)
    2.14 1 (2.8%)
    2.22 1 (2.8%)
    2.26 1 (2.8%)
    2.27 1 (2.8%)
    2.32 1 (2.8%)
    2.41 1 (2.8%)
    2.42 1 (2.8%)
    2.5 1 (2.8%)
    2.73 1 (2.8%)
    2.9 1 (2.8%)
    3.33 1 (2.8%)
    3.62 1 (2.8%)
    4.08 1 (2.8%)
    4.25 1 (2.8%)
    4.43 1 (2.8%)
    4.47 1 (2.8%)
    4.63 1 (2.8%)
    5.39 1 (2.8%)
    5.52 1 (2.8%)
Area Florestal(%)
    0.10 1 (2.8%)
    0.20 1 (2.8%)
    0.50 1 (2.8%)
    10.70 1 (2.8%)
    12.50 1 (2.8%)
    12.60 1 (2.8%)
    13.10 1 (2.8%)
    15.40 1 (2.8%)
    2.10 1 (2.8%)
    21.40 1 (2.8%)
    22.40 1 (2.8%)
    23.80 1 (2.8%)
    31.20 1 (2.8%)
    31.80 1 (2.8%)
    32.70 1 (2.8%)
    33.90 2 (5.6%)
    35.50 1 (2.8%)
    38.20 1 (2.8%)
    4.60 1 (2.8%)
    40.40 1 (2.8%)
    42.80 1 (2.8%)
    43.10 1 (2.8%)
    46.30 1 (2.8%)
    49.80 1 (2.8%)
    52.70 1 (2.8%)
    52.90 1 (2.8%)
    58.90 1 (2.8%)
    6.60 1 (2.8%)
    65.40 1 (2.8%)
    68.50 1 (2.8%)
    7.20 1 (2.8%)
    7.60 1 (2.8%)
    8.00 1 (2.8%)
    9.80 1 (2.8%)
    98.30 1 (2.8%)
PIB ($) 433,243,775,031 (26,161,501,013, 1,762,258,732,332)
Matrícula Bruta no Ensino Primário (%) 103 (100, 108)
Expectativa de Vida
    54.3 1 (2.8%)
    60.8 1 (2.8%)
    61.2 1 (2.8%)
    63.9 1 (2.8%)
    64.3 1 (2.8%)
    64.5 1 (2.8%)
    66.2 1 (2.8%)
    66.6 1 (2.8%)
    66.7 1 (2.8%)
    67.7 1 (2.8%)
    69.4 1 (2.8%)
    69.6 1 (2.8%)
    69.7 1 (2.8%)
    71.6 1 (2.8%)
    71.8 1 (2.8%)
    72.1 1 (2.8%)
    72.7 1 (2.8%)
    73.1 1 (2.8%)
    75 2 (5.6%)
    75.7 1 (2.8%)
    76.5 2 (5.6%)
    77 1 (2.8%)
    77.2 1 (2.8%)
    77.4 1 (2.8%)
    77.8 2 (5.6%)
    78.5 1 (2.8%)
    80.9 1 (2.8%)
    81.3 1 (2.8%)
    81.9 1 (2.8%)
    82.5 1 (2.8%)
    82.9 1 (2.8%)
    83 1 (2.8%)
    84.2 1 (2.8%)
Salário Mínimo
    0.01 1 (3.8%)
    0.21 1 (3.8%)
    0.30 1 (3.8%)
    0.31 1 (3.8%)
    0.43 1 (3.8%)
    0.49 1 (3.8%)
    0.50 1 (3.8%)
    0.53 1 (3.8%)
    0.54 1 (3.8%)
    0.65 1 (3.8%)
    0.71 1 (3.8%)
    0.87 1 (3.8%)
    0.88 1 (3.8%)
    1.53 1 (3.8%)
    1.58 1 (3.8%)
    1.66 1 (3.8%)
    10.13 1 (3.8%)
    11.16 1 (3.8%)
    3.11 1 (3.8%)
    3.35 1 (3.8%)
    3.45 1 (3.8%)
    3.85 1 (3.8%)
    6.77 1 (3.8%)
    7.25 1 (3.8%)
    9.51 1 (3.8%)
    9.99 1 (3.8%)
    Unknown 10
Despesas de Saúde do Próprio Bolso
    10.10 1 (2.9%)
    11.10 1 (2.9%)
    12.50 1 (2.9%)
    13.10 1 (2.9%)
    14.60 1 (2.9%)
    14.80 1 (2.9%)
    15.00 1 (2.9%)
    16.20 1 (2.9%)
    16.90 1 (2.9%)
    17.60 1 (2.9%)
    17.80 1 (2.9%)
    18.40 1 (2.9%)
    20.40 1 (2.9%)
    21.70 1 (2.9%)
    22.80 1 (2.9%)
    25.80 1 (2.9%)
    27.90 1 (2.9%)
    28.30 1 (2.9%)
    32.40 1 (2.9%)
    33.40 1 (2.9%)
    36.40 1 (2.9%)
    37.80 1 (2.9%)
    39.30 1 (2.9%)
    39.70 1 (2.9%)
    41.40 1 (2.9%)
    43.80 1 (2.9%)
    44.20 1 (2.9%)
    45.80 1 (2.9%)
    59.40 1 (2.9%)
    6.80 1 (2.9%)
    62.00 1 (2.9%)
    65.10 1 (2.9%)
    7.70 1 (2.9%)
    72.20 1 (2.9%)
    78.40 1 (2.9%)
    Unknown 1
Gross primary education enrollment (%)
    100.20 1 (2.8%)
    100.90 2 (5.6%)
    101.00 1 (2.8%)
    101.20 1 (2.8%)
    101.80 1 (2.8%)
    101.90 1 (2.8%)
    102.50 1 (2.8%)
    102.60 1 (2.8%)
    104.00 3 (8.3%)
    104.70 1 (2.8%)
    105.80 1 (2.8%)
    106.30 1 (2.8%)
    106.60 1 (2.8%)
    107.40 1 (2.8%)
    108.40 1 (2.8%)
    108.50 1 (2.8%)
    108.80 1 (2.8%)
    109.70 1 (2.8%)
    109.90 1 (2.8%)
    110.70 1 (2.8%)
    113.00 1 (2.8%)
    113.50 1 (2.8%)
    115.40 1 (2.8%)
    142.50 1 (2.8%)
    75.30 1 (2.8%)
    81.00 1 (2.8%)
    84.70 1 (2.8%)
    93.20 1 (2.8%)
    94.80 1 (2.8%)
    97.20 1 (2.8%)
    98.70 1 (2.8%)
    98.80 1 (2.8%)
    99.80 1 (2.8%)
Infant mortality 12 (6, 31)
    Unknown 1
1 n (%); Median (IQR)

Descrição da Tabela e das variáveis:

O software utilizado para criação de gráficos, análise e manejo de variáveis e criação de tabelas foi o R version 4.3.1. As variáveis utilizadas foram o PIB: Produto Interno Bruto (valor total dos bens e serviços produzidos no país), Emissões de CO2 (emissões de dióxido de carbono em toneladas), Área Florestada (%) (porcentagem de área coberta por florestas), Expectativa de vida (número médio de anos que se espera que um recém-nascido viva), Mortalidade Infantil (número de mortes por 1.000 nascidos vivos antes de completar um ano de idade), Matrícula bruta no ensino primário (%) (taxa bruta de matrícula no ensino primário), Despesas de saúde do próprio bolso (%) (percentagem das despesas totais com saúde pagas diretamente pelos indivíduos), Taxa Total de Imposto (carga tributária global como percentagem dos lucros comerciais), Taxa de fertilidade (número médio de filhos nascidos de uma mulher durante a sua vida), e Salário Mínimo (nível do salário mínimo em moeda local).

Das nossas 10 variáveis, a variável Emissão de CO2, PIB e Mortalidade Infantil são qualitativas, as 7 restantes são quantitativas. Todas as variáveis qualitativas aqui presentes se tratam de variáveis qualitativas ordinais politômicas. Por todas as variáveis serem compostas por valores numéricos, foram criadas faixas de valores para tornar as quantitativas desejadas em qualitativas. 
O banco de dados utilizado foi criado por Nidula Elgiriyewithana, em julho de 2023, e publicado no site Kaggle. O banco inicial era composto por 36 variáveis distintas que abordavam diversos aspectos de todos os países do mundo. Com base na análise das variáveis, foram selecionadas aquelas que exibem certa correlação, ou a ausência dela, que instiga análises globais por meio da comparação de aspectos semelhantes, mas em diferentes países. Isso é feito levando em consideração as distintas realidades sociais e econômicas de cada nação, bem como suas respectivas consequências. Ao selecionar os países, o objetivo foi escolher no mínimo 30 nações que fossem consideravelmente distintas entre si, tanto em termos de fatores sociais quanto econômicos. Os BRICS e o G7 fazem parte do conjunto escolhido, juntamente com países frequentemente negligenciados em análises globais comuns, esses foram adicionados com a finalidade de direcionar a atenção para esses países.
Para a análise entre as variáveis qualitativas PIB e Emissão de CO2, foi produzido o gráfico em barras empilhadas. A pergunta que guiou essa análise foi: “O quanto o PIB aumenta de acordo com a quantidade de emissão de CO2?”. Já para a análise entre as variáveis quantitativas Área Florestal e Expectativa de Vida, foi feito o gráfico de dispersão. Nesse caso, a pergunta guia foi: “A presença de maior área florestal em um país aumenta a expectativa de vida da população?”. Ademais, para a análise entre a variável qualitativa Mortalidade Infantil e a quantitativa Matrícula em Ensino Primário, foi usado o gráfico Boxplot. A pergunta que guiou essa análise foi: “Países com mais matrículas no Ensino Primário possuem menor Mortalidade Infantil?”. Nesse caso, foi produzido, além do gráfico de Boxplot, um gráfico em barras com o nome de países para que uma comparação pudesse ser feita.. Mais duas análises entre quantitativas foram realizadas, sendo uma feita a partir da relação entre as variáveis Despesas de Saúde do Próprio Bolso e Taxa Total de Imposto em Cada País e outra realizada entre as variáveis Taxa de Fertilidade e Salário Mínimo. Respectivamente, as perguntas que guiaram essas duas análises foram: “Como os impostos são direcionados para a saúde pública?” e “Países com um salário mínimo mais elevado influenciam no aumento da taxa de fertilidade?”. Em ambas análises o gráfico de dispersão foi utilizado. Na relação entre taxa de natalidade e salário mínimo foi produzido, além do gráfico de dispersão, um gráfico de barras complementar para que pudesse ser observado em que faixas haveria altas ou baixas taxas de natalidade.

A tabela foi obtida a partir da seleção de alguns fatores do banco de dados, tanto quantitativos, como: Expectativa de Vida (Em anos), Área florestal (%), Número Bruto de Matrículas no Ensino Fundamental (%), Despesas de Saúde do Próprio Bolso ($) , Taxa Total de Imposto (%), Taxa de Fertilidade (%), Taxa de Natalidade (%) e Salário mínimo ($), quanto qualitativas, sendo estas o PIB, a Emissão de CO2 e Mortalidade Infantil (sendo que as variáveis qualitativas eram quantitativas, e precisaram ser modificadas para atender as comparações desejadas).

Abaixo, estão as medidas de mediana, média e IQR de cada variável quantitativa, que foram obtidas à partir do seguinte código:

#```{r}
#library(gtsummary)
#dados<-world_data_2023
#tbl_summary(dados) %>% modify_header(label ~ "Variáveis") %>%
#modify_caption("Tabela 1. Valores dos países.") %>% bold_labels()

Expectativa de Vida: Mediana: 74,05 IQR: 10,35 Média: 72,98 Área Florestal: Mediana: 27,50 IQR: 33,52 Média: 28,75 Matrícula fundamental: Mediana: 103,30 IQR: 8,33 Média: 103,33 Despesas saúde: Mediana: 25,80 IQR: 24,95 Média: 30,59 Taxa Total de Imposto: Mediana: 43,35 IQR: 19,50 Média: 43,89 Taxa de Natalidade: Mediana: 17,83 IQR: 13,47 Média: 19,39 Taxa de Fertilidade: Mediana: 2,18 IQR: 1,32 Média: 2,57 Salário Mínimo: Mediana: 1,21 IQR: 3,24 Média: 3,07

##Vendo a estrutura dos dados

str(dados)
tibble [36 × 12] (S3: tbl_df/tbl/data.frame)
 $ País                                  : chr [1:36] "Saudi Arabia" "Mongolia" "China" "Madagascar" ...
 $ Taxa Total de Imposto (%)             : chr [1:36] "15.70" "25.70" "59.20" "38.30" ...
 $ Emissão de Co2                        : num [1:36] 563449 486406 9893038 51 120369 ...
 $ Taxa de Fertilidade                   : chr [1:36] "2.32" "2.13" "1.69" "1.44" ...
 $ Area Florestal(%)                     : chr [1:36] "0.50" "33.90" "22.40" "43.10" ...
 $ PIB ($)                               : num [1:36] 7.93e+11 1.26e+12 1.99e+13 6.55e+09 4.48e+11 ...
 $ Matrícula Bruta no Ensino Primário (%): num [1:36] 99.8 105.8 100.2 104.7 84.7 ...
 $ Expectativa de Vida                   : chr [1:36] "75" "75" "77" "83" ...
 $ Salário Mínimo                        : chr [1:36] "1.66" "3.11" "0.88" "3.85" ...
 $ Despesas de Saúde do Próprio Bolso    : chr [1:36] "44.20" "39.30" "32.40" "21.70" ...
 $ Gross primary education enrollment (%): chr [1:36] "99.80" "104.00" "100.20" "142.50" ...
 $ Infant mortality                      : num [1:36] 6 14 7.4 38.2 36.2 51.6 33.9 28.5 49.8 47.9 ...

##Traduzindo o nome de variáveis

colnames(dados)
 [1] "País"                                  
 [2] "Taxa Total de Imposto (%)"             
 [3] "Emissão de Co2"                        
 [4] "Taxa de Fertilidade"                   
 [5] "Area Florestal(%)"                     
 [6] "PIB ($)"                               
 [7] "Matrícula Bruta no Ensino Primário (%)"
 [8] "Expectativa de Vida"                   
 [9] "Salário Mínimo"                        
[10] "Despesas de Saúde do Próprio Bolso"    
[11] "Gross primary education enrollment (%)"
[12] "Infant mortality"                      
colnames(dados)[10]<-"PIB"
colnames(dados)[18]<-"Matrícula Bruta no Ensino Primário"
colnames(dados)[19]<-"Mortalidade Infantil"

##Precisamos de no mínimo 2 variáveis quali e 2 quanti; vamos transformar uma quanti em quali através da criação de uma faixa de valores:

#Transformar PIB em qualitativa:

dados$PIB<-cut(dados$`PIB ($)`,c(0,3318716360,5354435962732,10712190641821,16069945320911,214277000000000))
levels(dados$`PIB ($)`)<-c("De 0 a 3318716360", "De 3318716360 a 5354435962732", "De 10712190641821 a 16069945320911","De 16069945320911 a 21427700000000 ", "Mais de 21427700000000")

#Transformar EMISSÃO DE CARBONO em qualitativa:

# world_data_2023$`Emissão de Co2`<-cut(world_data_2023$`Emissão de Co2`,c(0,1738,2471957,4945651,7419345,9893038))
# world_data_2023$`Emissão de Co2`

world_data_2023$`Emissão de Co2`
 [1]  563449.00  486406.00 9893038.00      51.00  120369.00   34693.00
 [7]   10983.00  476644.00    3282.00    8672.00      14.87     620.00
[13]    3905.00   10902.00 2407672.00    9919.00   25368.00    1738.00
[19]     238.56  164175.00 1732027.00    7169.00  462299.00  201348.00
[25]     661.71   32424.00  372725.00    6766.00  206324.00 5006302.00
[31]  727973.00  379025.00  544894.00  303276.00  320411.00 1135886.00
levels(world_data_2023$`Emissão de Co2`)<-c("De 0 a 1738", "De 1738 a 2471957", "De 4945651 a 7419345","De 7419345 a 9893038", "Mais de 9893038")

#Transformar MORTALIDADE INFANTIL em qualitativa:

# world_data_2023$`Infant mortality`<-cut(world_data_2023$`Infant mortality`,c(0,40,60,2000)) 

world_data_2023$`Infant mortality` 
 [1]  6.0 14.0  7.4 38.2 36.2 51.6 33.9 28.5 49.8 47.9  3.4 18.1 11.0 31.8 12.4
[16] 24.0 75.7 16.9 11.8 21.4  6.1 39.1 12.8  8.8  2.6  4.6  9.1  6.4  6.5  5.6
[31] 29.9  3.6  4.3  3.1  1.8   NA
levels(world_data_2023$`Infant mortality`)<-c("Até 40 mortes", "Mais que 40 mortes e até 60 mortes", "Mais que 60 mortes")

Perguntas e seus respctivos gráficos:

Criando o Gráfico com o uso de duas qualitativas:

O quanto o PIB aumenta de acordo com a quantidade de emissão de CO2?

str(world_data_2023)
tibble [36 × 19] (S3: tbl_df/tbl/data.frame)
 $ País                                  : chr [1:36] "Saudi Arabia" "Mongolia" "China" "Madagascar" ...
 $ Taxa Total de Imposto (%)             : chr [1:36] "15.70" "25.70" "59.20" "38.30" ...
 $ Densidade (P/Km2)"                    : num [1:36] 16 66 153 238 226 26 38 49 16 60 ...
 $ Terras Agrícolas(%)                   : chr [1:36] "80.80" "54.60" "56.20" "32.20" ...
 $ Land Area(Km2)                        : chr [1:36] "2149690" "1964375" "9596960" "160" ...
 $ Taxa de Natalidade                    : chr [1:36] "17.8" "17.6" "10.9" "9.9" ...
 $ Emissão de Co2                        : num [1:36] 563449 486406 9893038 51 120369 ...
  ..- attr(*, "levels")= chr [1:5] "De 0 a 1738" "De 1738 a 2471957" "De 4945651 a 7419345" "De 7419345 a 9893038" ...
 $ Taxa de Fertilidade                   : chr [1:36] "2.32" "2.13" "1.69" "1.44" ...
 $ Area Florestal(%)                     : chr [1:36] "0.50" "33.90" "22.40" "43.10" ...
 $ PIB ($)                               : num [1:36] 7.93e+11 1.26e+12 1.99e+13 6.55e+09 4.48e+11 ...
 $ Matrícula Bruta no Ensino Primário (%): num [1:36] 99.8 105.8 100.2 104.7 84.7 ...
 $ Expectativa de Vida                   : chr [1:36] "75" "75" "77" "83" ...
 $ Salário Mínimo                        : chr [1:36] "1.66" "3.11" "0.88" "3.85" ...
 $ Despesas de Saúde do Próprio Bolso    : chr [1:36] "44.20" "39.30" "32.40" "21.70" ...
 $ População                             : chr [1:36] "34268528" "126014024" "1397715000" "38019" ...
 $ Taxa de Desemprego                    : chr [1:36] "6.60" "6.01" "4.32" "1.76" ...
 $ População Urbana                      : chr [1:36] "28807838" "102626859" "842933962" "5464" ...
 $ Gross primary education enrollment (%): chr [1:36] "99.80" "104.00" "100.20" "142.50" ...
 $ Infant mortality                      : num [1:36] 6 14 7.4 38.2 36.2 51.6 33.9 28.5 49.8 47.9 ...
  ..- attr(*, "levels")= chr [1:3] "Até 40 mortes" "Mais que 40 mortes e até 60 mortes" "Mais que 60 mortes"
library(ggplot2)

ggplot(world_data_2023) +
 aes(x = `Emissão de Co2`, y = `PIB ($)`) +
 geom_tile() +
 labs(x = " Emissões de dióxido de carbono em toneladas", 
 y = "PIB, valor total dos bens e serviços produzidos no país", title = "Emissão de C02 em relação ao PIB", 
 subtitle = "Um panorama global") +
 theme_minimal() +
 theme(plot.title = element_text(face = "bold", 
 hjust = 0.5), plot.subtitle = element_text(size = 13L, face = "italic", hjust = 0.5))

Criando o Gráfico com o uso de duas quantitativas:

A presença de maior área florestal aumenta a expectativa de vida da população?

library(readxl)
expect_vida <- read_excel("trabalho bioestatistica_files/expect_vida.xlsx", 
    col_types = c("text", "numeric", "numeric"))
Warning: Coercing text to numeric in B2 / R2C2: '0.50'
Warning: Coercing text to numeric in B3 / R3C2: '33.90'
Warning: Coercing text to numeric in B4 / R4C2: '22.40'
Warning: Coercing text to numeric in B5 / R5C2: '43.10'
Warning: Coercing text to numeric in B6 / R6C2: '7.20'
Warning: Coercing text to numeric in C6 / R6C3: '54.3'
Warning: Coercing text to numeric in B7 / R7C2: '46.30'
Warning: Coercing text to numeric in C7 / R7C3: '60.8'
Warning: Coercing text to numeric in B8 / R8C2: '35.50'
Warning: Coercing text to numeric in C8 / R8C3: '61.2'
Warning: Coercing text to numeric in B9 / R9C2: '7.60'
Warning: Coercing text to numeric in C9 / R9C3: '63.9'
Warning: Coercing text to numeric in B10 / R10C2: '65.40'
Warning: Coercing text to numeric in C10 / R10C3: '64.3'
Warning: Coercing text to numeric in B11 / R11C2: '2.10'
Warning: Coercing text to numeric in C11 / R11C3: '64.5'
Warning: Coercing text to numeric in B12 / R12C2: '12.50'
Warning: Coercing text to numeric in C12 / R12C3: '66.2'
Warning: Coercing text to numeric in B13 / R13C2: '0.20'
Warning: Coercing text to numeric in C13 / R13C3: '66.6'
Warning: Coercing text to numeric in B14 / R14C2: '21.40'
Warning: Coercing text to numeric in C14 / R14C3: '66.7'
Warning: Coercing text to numeric in B15 / R15C2: '42.80'
Warning: Coercing text to numeric in C15 / R15C3: '67.7'
Warning: Coercing text to numeric in B16 / R16C2: '23.80'
Warning: Coercing text to numeric in C16 / R16C3: '69.4'
Warning: Coercing text to numeric in B17 / R17C2: '52.90'
Warning: Coercing text to numeric in C17 / R17C3: '69.6'
Warning: Coercing text to numeric in B18 / R18C2: '8.00'
Warning: Coercing text to numeric in C18 / R18C3: '69.7'
Warning: Coercing text to numeric in B19 / R19C2: '98.30'
Warning: Coercing text to numeric in C19 / R19C3: '71.6'
Warning: Coercing text to numeric in B20 / R20C2: '0.10'
Warning: Coercing text to numeric in C20 / R20C3: '71.8'
Warning: Coercing text to numeric in B21 / R21C2: '52.70'
Warning: Coercing text to numeric in C21 / R21C3: '72.1'
Warning: Coercing text to numeric in B22 / R22C2: '49.80'
Warning: Coercing text to numeric in C22 / R22C3: '72.7'
Warning: Coercing text to numeric in B23 / R23C2: '12.60'
Warning: Coercing text to numeric in C23 / R23C3: '73.1'
Warning: Coercing text to numeric in B24 / R24C2: '58.90'
Warning: Coercing text to numeric in C24 / R24C3: '75.7'
Warning: Coercing text to numeric in B25 / R25C2: '9.80'
Warning: Coercing text to numeric in C25 / R25C3: '76.5'
Warning: Coercing text to numeric in B26 / R26C2: '6.60'
Warning: Coercing text to numeric in C26 / R26C3: '76.5'
Warning: Coercing text to numeric in B27 / R27C2: '40.40'
Warning: Coercing text to numeric in C27 / R27C3: '77.2'
Warning: Coercing text to numeric in B28 / R28C2: '15.40'
Warning: Coercing text to numeric in C28 / R28C3: '77.4'
Warning: Coercing text to numeric in B29 / R29C2: '10.70'
Warning: Coercing text to numeric in C29 / R29C3: '77.8'
Warning: Coercing text to numeric in B30 / R30C2: '4.60'
Warning: Coercing text to numeric in C30 / R30C3: '77.8'
Warning: Coercing text to numeric in B31 / R31C2: '33.90'
Warning: Coercing text to numeric in C31 / R31C3: '78.5'
Warning: Coercing text to numeric in B32 / R32C2: '32.70'
Warning: Coercing text to numeric in C32 / R32C3: '80.9'
Warning: Coercing text to numeric in B33 / R33C2: '13.10'
Warning: Coercing text to numeric in C33 / R33C3: '81.3'
Warning: Coercing text to numeric in B34 / R34C2: '38.20'
Warning: Coercing text to numeric in C34 / R34C3: '81.9'
Warning: Coercing text to numeric in B35 / R35C2: '31.20'
Warning: Coercing text to numeric in C35 / R35C3: '82.5'
Warning: Coercing text to numeric in B36 / R36C2: '31.80'
Warning: Coercing text to numeric in C36 / R36C3: '82.9'
Warning: Coercing text to numeric in B37 / R37C2: '68.50'
Warning: Coercing text to numeric in C37 / R37C3: '84.2'
View(expect_vida)


library(ggplot2)

ggplot(expect_vida) +
 aes(x = `Area Florestal(%)`, y = `Expectativa de Vida`) +
 geom_point(shape = "circle", 
 size = 1.5, colour = "#112446") +
 labs(x = "Área Florestal (%): Porcentagem de área coberta por florestas", 
 y = "Número médio de anos que se espera que um recém-nascido viva", title = "Expectativa de Vida relacionada à Área Florestal", 
 subtitle = "Um panorama global") +
 theme_minimal()

Criando o Gráfico com o uso de uma qualitativa e uma quantitativa:

Países com mais matrículas no ensino primário tem menor mortalidade infantil?

library(readxl)
mort_matri <- read_excel("trabalho bioestatistica_files/mort_matri.xlsx", 
    col_types = c("text", "numeric", "numeric"))
Warning: Coercing text to numeric in B2 / R2C2: '99.80'
Warning: Coercing text to numeric in B3 / R3C2: '105.80'
Warning: Coercing text to numeric in B4 / R4C2: '100.20'
Warning: Coercing text to numeric in C4 / R4C3: '7.4'
Warning: Coercing text to numeric in B5 / R5C2: '104.70'
Warning: Coercing text to numeric in C5 / R5C3: '38.2'
Warning: Coercing text to numeric in B6 / R6C2: '84.70'
Warning: Coercing text to numeric in C6 / R6C3: '36.2'
Warning: Coercing text to numeric in B7 / R7C2: '113.50'
Warning: Coercing text to numeric in C7 / R7C3: '51.6'
Warning: Coercing text to numeric in B8 / R8C2: '109.90'
Warning: Coercing text to numeric in C8 / R8C3: '33.9'
Warning: Coercing text to numeric in B9 / R9C2: '100.90'
Warning: Coercing text to numeric in C9 / R9C3: '28.5'
Warning: Coercing text to numeric in B10 / R10C2: '106.60'
Warning: Coercing text to numeric in C10 / R10C3: '49.8'
Warning: Coercing text to numeric in B11 / R11C2: '104.00'
Warning: Coercing text to numeric in C11 / R11C3: '47.9'
Warning: Coercing text to numeric in B12 / R12C2: '101.00'
Warning: Coercing text to numeric in C12 / R12C3: '3.4'
Warning: Coercing text to numeric in B13 / R13C2: '75.30'
Warning: Coercing text to numeric in C13 / R13C3: '18.1'
Warning: Coercing text to numeric in B14 / R14C2: '142.50'
Warning: Coercing text to numeric in B15 / R15C2: '81.00'
Warning: Coercing text to numeric in C15 / R15C3: '31.8'
Warning: Coercing text to numeric in B16 / R16C2: '113.00'
Warning: Coercing text to numeric in C16 / R16C3: '12.4'
Warning: Coercing text to numeric in B17 / R17C2: '107.40'
Warning: Coercing text to numeric in B18 / R18C2: '104.00'
Warning: Coercing text to numeric in C18 / R18C3: '75.7'
Warning: Coercing text to numeric in B19 / R19C2: '108.80'
Warning: Coercing text to numeric in C19 / R19C3: '16.9'
Warning: Coercing text to numeric in B20 / R20C2: '106.30'
Warning: Coercing text to numeric in C20 / R20C3: '11.8'
Warning: Coercing text to numeric in B21 / R21C2: '97.20'
Warning: Coercing text to numeric in C21 / R21C3: '21.4'
Warning: Coercing text to numeric in B22 / R22C2: '102.60'
Warning: Coercing text to numeric in C22 / R22C3: '6.1'
Warning: Coercing text to numeric in B23 / R23C2: '94.80'
Warning: Coercing text to numeric in C23 / R23C3: '39.1'
Warning: Coercing text to numeric in B24 / R24C2: '115.40'
Warning: Coercing text to numeric in C24 / R24C3: '12.8'
Warning: Coercing text to numeric in B25 / R25C2: '109.70'
Warning: Coercing text to numeric in C25 / R25C3: '8.8'
Warning: Coercing text to numeric in B26 / R26C2: '110.70'
Warning: Coercing text to numeric in C26 / R26C3: '2.6'
Warning: Coercing text to numeric in B27 / R27C2: '98.70'
Warning: Coercing text to numeric in C27 / R27C3: '4.6'
Warning: Coercing text to numeric in B28 / R28C2: '93.20'
Warning: Coercing text to numeric in C28 / R28C3: '9.1'
Warning: Coercing text to numeric in B29 / R29C2: '108.50'
Warning: Coercing text to numeric in C29 / R29C3: '6.4'
Warning: Coercing text to numeric in B30 / R30C2: '108.40'
Warning: Coercing text to numeric in C30 / R30C3: '6.5'
Warning: Coercing text to numeric in B31 / R31C2: '101.80'
Warning: Coercing text to numeric in C31 / R31C3: '5.6'
Warning: Coercing text to numeric in B32 / R32C2: '104.00'
Warning: Coercing text to numeric in C32 / R32C3: '29.9'
Warning: Coercing text to numeric in B33 / R33C2: '101.20'
Warning: Coercing text to numeric in C33 / R33C3: '3.6'
Warning: Coercing text to numeric in B34 / R34C2: '100.90'
Warning: Coercing text to numeric in C34 / R34C3: '4.3'
Warning: Coercing text to numeric in B35 / R35C2: '102.50'
Warning: Coercing text to numeric in C35 / R35C3: '3.1'
Warning: Coercing text to numeric in B36 / R36C2: '101.90'
Warning: Coercing text to numeric in C36 / R36C3: '1.8'
Warning: Coercing text to numeric in B37 / R37C2: '98.80'
View(mort_matri)

mort_matri$`Infant mortality`<-cut(mort_matri$`Infant mortality`,c(0,40,60,2000)) 

mort_matri$`Infant mortality` 
 [1] (0,40]     (0,40]     (0,40]     (0,40]     (0,40]     (40,60]   
 [7] (0,40]     (0,40]     (40,60]    (40,60]    (0,40]     (0,40]    
[13] (0,40]     (0,40]     (0,40]     (0,40]     (60,2e+03] (0,40]    
[19] (0,40]     (0,40]     (0,40]     (0,40]     (0,40]     (0,40]    
[25] (0,40]     (0,40]     (0,40]     (0,40]     (0,40]     (0,40]    
[31] (0,40]     (0,40]     (0,40]     (0,40]     (0,40]     <NA>      
Levels: (0,40] (40,60] (60,2e+03]
levels(mort_matri$`Infant mortality`)<-c("Até 40 mortes", "Mais que 40 mortes e até 60 mortes", "Mais que 60 mortes")


library(dplyr)

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
library(ggplot2)

mort_matri %>%
 filter(`Matrícula Bruta no Ensino Primário (%)` >= 75 & `Matrícula Bruta no Ensino Primário (%)` <= 
 120.5) %>%
 filter(!is.na(`Infant mortality`)) %>%
 ggplot() +
 aes(x = `Matrícula Bruta no Ensino Primário (%)`, y = `Infant mortality`) +
 geom_boxplot(fill = "#112446") +
 labs(x = "Taxa bruta de matrícula no ensino primário (%)", y = "Mortalidade Infantil: Número de mortes por 1.000 nascidos vivos antes de completar um ano de idade", 
 title = "Mortalidade Infantil e a percentagem de matriculados no Ensino Primário", subtitle = "Um panorama global") +
 coord_flip() +
 theme_minimal() +
 theme(plot.title = element_text(face = "bold", hjust = 0.5), plot.subtitle = element_text(size = 13L, 
 face = "italic", hjust = 0.5))

#Gráfico complementar:

library(readxl)
maior_mortalidade_ <- read_excel("trabalho bioestatistica_files/maior_mortalidade,.xlsx", 
    col_types = c("text", "text", "text"))
View(maior_mortalidade_)


library(ggplot2)

ggplot(maior_mortalidade_) +
 aes(x = `Infant mortality`, y = `Gross primary education enrollment (%)`, 
 fill = País) +
 geom_tile() +
 scale_fill_hue(direction = 1) +
 labs(x = "Número de mortes por 1.000 nascidos vivos antes de completar um ano de idade", 
 y = "Taxa bruta de matrícula no ensino primário", title = "Mortalidade Infantil e a percentagem de matriculados no Ensino Primário", 
 subtitle = "Um recorte de quatro países") +
 theme_minimal() +
 theme(plot.title = element_text(face = "bold", 
 hjust = 0.5), plot.subtitle = element_text(size = 13L, face = "italic", hjust = 0.5))

Criando o Gráfico com o uso de duas quantitativas:

Como os impostos são direcionados para a saúde pública?

library(readxl)
world_data_2023 <- read_excel("trabalho bioestatistica_files/world-data-2023.xlsx", 
    col_types = c("text", "numeric", "numeric", 
        "text", "text", "text", "text", "text", 
        "text", "numeric", "text", "text", 
        "text", "numeric", "text", "text", 
        "numeric", "text", "text"))
Warning: Coercing text to numeric in B2 / R2C2: '15.70'
Warning: Coercing text to numeric in N2 / R2C14: '44.20'
Warning: Coercing text to numeric in B3 / R3C2: '25.70'
Warning: Coercing text to numeric in N3 / R3C14: '39.30'
Warning: Coercing text to numeric in B4 / R4C2: '59.20'
Warning: Coercing text to numeric in N4 / R4C14: '32.40'
Warning: Coercing text to numeric in B5 / R5C2: '38.30'
Warning: Coercing text to numeric in N5 / R5C14: '21.70'
Warning: Coercing text to numeric in B6 / R6C2: '54.30'
Warning: Coercing text to numeric in N6 / R6C14: '36.40'
Warning: Coercing text to numeric in B7 / R7C2: '49.10'
Warning: Coercing text to numeric in N7 / R7C14: '33.40'
Warning: Coercing text to numeric in B8 / R8C2: '31.60'
Warning: Coercing text to numeric in B9 / R9C2: '29.20'
Warning: Coercing text to numeric in N9 / R9C14: '10.10'
Warning: Coercing text to numeric in B10 / R10C2: '37.90'
Warning: Coercing text to numeric in N10 / R10C14: '43.80'
Warning: Coercing text to numeric in B11 / R11C2: '71.40'
Warning: Coercing text to numeric in N11 / R11C14: '78.40'
Warning: Coercing text to numeric in B12 / R12C2: '60.70'
Warning: Coercing text to numeric in N12 / R12C14: '37.80'
Warning: Coercing text to numeric in B13 / R13C2: '44.40'
Warning: Coercing text to numeric in N13 / R13C14: '20.40'
Warning: Coercing text to numeric in B14 / R14C2: '55.10'
Warning: Coercing text to numeric in N14 / R14C14: '41.40'
Warning: Coercing text to numeric in B15 / R15C2: '44.80'
Warning: Coercing text to numeric in N15 / R15C14: '18.40'
Warning: Coercing text to numeric in B16 / R16C2: '44.70'
Warning: Coercing text to numeric in N16 / R16C14: '65.10'
Warning: Coercing text to numeric in B17 / R17C2: '23.10'
Warning: Coercing text to numeric in N17 / R17C14: '59.40'
Warning: Coercing text to numeric in B18 / R18C2: '34.80'
Warning: Coercing text to numeric in N18 / R18C14: '72.20'
Warning: Coercing text to numeric in B19 / R19C2: '27.90'
Warning: Coercing text to numeric in N19 / R19C14: '16.90'
Warning: Coercing text to numeric in B20 / R20C2: '36.40'
Warning: Coercing text to numeric in N20 / R20C14: '62.00'
Warning: Coercing text to numeric in B21 / R21C2: '73.30'
Warning: Coercing text to numeric in N21 / R21C14: '25.80'
Warning: Coercing text to numeric in B22 / R22C2: '46.20'
Warning: Coercing text to numeric in N22 / R22C14: '15.00'
Warning: Coercing text to numeric in B23 / R23C2: '37.70'
Warning: Coercing text to numeric in N23 / R23C14: '27.90'
Warning: Coercing text to numeric in B24 / R24C2: '65.10'
Warning: Coercing text to numeric in N24 / R24C14: '28.30'
Warning: Coercing text to numeric in B25 / R25C2: '106.30'
Warning: Coercing text to numeric in N25 / R25C14: '17.60'
Warning: Coercing text to numeric in B26 / R26C2: '59.10'
Warning: Coercing text to numeric in N26 / R26C14: '39.70'
Warning: Coercing text to numeric in B27 / R27C2: '49.70'
Warning: Coercing text to numeric in N27 / R27C14: '7.70'
Warning: Coercing text to numeric in B28 / R28C2: '42.30'
Warning: Coercing text to numeric in N28 / R28C14: '17.80'
Warning: Coercing text to numeric in B29 / R29C2: '41.80'
Warning: Coercing text to numeric in N29 / R29C14: '45.80'
Warning: Coercing text to numeric in B30 / R30C2: '15.90'
Warning: Coercing text to numeric in N30 / R30C14: '14.80'
Warning: Coercing text to numeric in B31 / R31C2: '36.60'
Warning: Coercing text to numeric in N31 / R31C14: '16.20'
Warning: Coercing text to numeric in B32 / R32C2: '49.70'
Warning: Coercing text to numeric in N32 / R32C14: '12.50'
Warning: Coercing text to numeric in B33 / R33C2: '30.60'
Warning: Coercing text to numeric in N33 / R33C14: '11.10'
Warning: Coercing text to numeric in B34 / R34C2: '24.50'
Warning: Coercing text to numeric in N34 / R34C14: '14.60'
Warning: Coercing text to numeric in B35 / R35C2: '48.80'
Warning: Coercing text to numeric in N35 / R35C14: '6.80'
Warning: Coercing text to numeric in B36 / R36C2: '46.70'
Warning: Coercing text to numeric in N36 / R36C14: '22.80'
Warning: Coercing text to numeric in B37 / R37C2: '21.60'
Warning: Coercing text to numeric in N37 / R37C14: '13.10'
View(world_data_2023)

library(ggplot2)

ggplot(world_data_2023) +
 aes(x = `Taxa Total de Imposto (%)`, y = `Despesas de Saúde do Próprio Bolso`) +
 geom_point(shape = "circle", size = 2.95, colour = "#0ADF79") +
 labs(x = "Taxa total de imposto (%)", 
 y = "Despesas de Saúde do Próprio Bolso (%)", title = "Como os impostos são direcionados para a saúde pública?") +
 theme_minimal() +
 theme(plot.title = element_text(size = 18L, face = "bold", hjust = 0.5), axis.title.y = element_text(size = 15L, 
 face = "bold"), axis.title.x = element_text(size = 15L, face = "bold"))
Warning: Removed 1 rows containing missing values (`geom_point()`).

Criando o Gráfico com o uso de duas quantitativas:

Países com um salário mínimo mais elevado influenciam no aumento da taxa de fertilidade?

library(readxl)
fertilidade <- read_excel("trabalho bioestatistica_files/fertilidade.xlsx", 
    col_types = c("text", "numeric", "numeric"))
Warning: Coercing text to numeric in B2 / R2C2: '2.32'
Warning: Coercing text to numeric in C2 / R2C3: '1.66'
Warning: Coercing text to numeric in B3 / R3C2: '2.13'
Warning: Coercing text to numeric in C3 / R3C3: '3.11'
Warning: Coercing text to numeric in B4 / R4C2: '1.69'
Warning: Coercing text to numeric in C4 / R4C3: '0.88'
Warning: Coercing text to numeric in B5 / R5C2: '1.44'
Warning: Coercing text to numeric in C5 / R5C3: '3.85'
Warning: Coercing text to numeric in B6 / R6C2: '5.39'
Warning: Coercing text to numeric in C6 / R6C3: '10.13'
Warning: Coercing text to numeric in B7 / R7C2: '5.52'
Warning: Coercing text to numeric in C7 / R7C3: '0.71'
Warning: Coercing text to numeric in B8 / R8C2: '3.62'
Warning: Coercing text to numeric in B9 / R9C2: '2.41'
Warning: Coercing text to numeric in B10 / R10C2: '4.43'
Warning: Coercing text to numeric in C10 / R10C3: '0.50'
Warning: Coercing text to numeric in B11 / R11C2: '4.47'
Warning: Coercing text to numeric in C11 / R11C3: '0.43'
Warning: Coercing text to numeric in B12 / R12C2: '4.25'
Warning: Coercing text to numeric in C12 / R12C3: '1.58'
Warning: Coercing text to numeric in B13 / R13C2: '2.73'
Warning: Coercing text to numeric in C13 / R13C3: '11.16'
Warning: Coercing text to numeric in B14 / R14C2: '4.08'
Warning: Coercing text to numeric in C14 / R14C3: '0.31'
Warning: Coercing text to numeric in B15 / R15C2: '4.63'
Warning: Coercing text to numeric in C15 / R15C3: '0.01'
Warning: Coercing text to numeric in B16 / R16C2: '2.22'
Warning: Coercing text to numeric in C16 / R16C3: '0.49'
Warning: Coercing text to numeric in B17 / R17C2: '2.5'
Warning: Coercing text to numeric in C17 / R17C3: '9.51'
Warning: Coercing text to numeric in B18 / R18C2: '2.9'
Warning: Coercing text to numeric in C18 / R18C3: '3.45'
Warning: Coercing text to numeric in B19 / R19C2: '2.42'
Warning: Coercing text to numeric in B20 / R20C2: '3.33'
Warning: Coercing text to numeric in C20 / R20C3: '9.99'
Warning: Coercing text to numeric in B21 / R21C2: '2.27'
Warning: Coercing text to numeric in B22 / R22C2: '1.57'
Warning: Coercing text to numeric in C22 / R22C3: '7.25'
Warning: Coercing text to numeric in B23 / R23C2: '2.04'
Warning: Coercing text to numeric in C23 / R23C3: '0.30'
Warning: Coercing text to numeric in B24 / R24C2: '1.73'
Warning: Coercing text to numeric in C24 / R24C3: '1.53'
Warning: Coercing text to numeric in B25 / R25C2: '2.26'
Warning: Coercing text to numeric in C25 / R25C3: '3.35'
Warning: Coercing text to numeric in B26 / R26C2: '2.14'
Warning: Coercing text to numeric in C26 / R26C3: '0.65'
Warning: Coercing text to numeric in B27 / R27C2: '1.52'
Warning: Coercing text to numeric in B28 / R28C2: '2.07'
Warning: Coercing text to numeric in B29 / R29C2: '1.97'
Warning: Coercing text to numeric in B30 / R30C2: '1.41'
Warning: Coercing text to numeric in B31 / R31C2: '1.73'
Warning: Coercing text to numeric in B32 / R32C2: '1.56'
Warning: Coercing text to numeric in C32 / R32C3: '0.21'
Warning: Coercing text to numeric in B33 / R33C2: '1.68'
Warning: Coercing text to numeric in B34 / R34C2: '1.5'
Warning: Coercing text to numeric in C34 / R34C3: '0.87'
Warning: Coercing text to numeric in B35 / R35C2: '1.88'
Warning: Coercing text to numeric in C35 / R35C3: '6.77'
Warning: Coercing text to numeric in B36 / R36C2: '1.29'
Warning: Coercing text to numeric in C36 / R36C3: '0.54'
Warning: Coercing text to numeric in B37 / R37C2: '1.42'
Warning: Coercing text to numeric in C37 / R37C3: '0.53'
View(fertilidade)


library(dplyr)
 library(ggplot2)
 
 fertilidade %>%
  filter(!is.na(`Salário Mínimo`)) %>%
  ggplot() +
  aes(x = `Taxa de Fertilidade`, y = `Salário Mínimo`, fill = País) +
  geom_point(shape = "circle", 
  size = 1.5, colour = "#112446") +
  scale_fill_viridis_d(option = "magma", direction = -1) +
  labs(x = "Número médio de filhos nascidos de uma mulher durante a sua vida", 
  y = "Nível do salário mínimo em moeda local", title = "Relação entre Taxa de Fertilidade e Salário Mínimo", 
  subtitle = "Um panorama global") +
  theme_minimal() +
  theme(plot.title = element_text(face = "bold", 
  hjust = 0.5), plot.subtitle = element_text(size = 13L, face = "italic", hjust = 0.5))