Introduction

This report explores country-level counts of specialist medical practitioners using the WHO NHWA data included in the file Specialist Medical practitioners by country.csv. The dataset contains the indicator “Specialist medical practitioners (number)” for multiple countries, along with associated WHO regions and reporting years. The analysis focuses on visual comparisons across countries, regions, and reporting periods, using only the variables available in the dataset.

Data preparation

Read the file

df <- read_csv("C:\\Users\\Pradnya\\Downloads\\Specialist Medical practitioners by country.csv")
## Rows: 156 Columns: 34
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (12): IndicatorCode, Indicator, ValueType, ParentLocationCode, ParentLo...
## dbl   (2): Period, FactValueNumeric
## lgl  (19): IsLatestYear, Dim1 type, Dim1, Dim1ValueCode, Dim2 type, Dim2, Di...
## dttm  (1): DateModified
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

Data Cleaning.

prac <- df %>%

  select(

    ParentLocation,

    Location,

    Period,

    FactValueNumeric,

  )

Renaming Attributes

Visualization

Figure 1 :- Top 20 countries by number of specialist medical practitioners

top20 <- prac %>%

  arrange(desc(Specialists)) %>%

  slice_head(n = 20)

 

ggplot(top20, aes(x = fct_reorder(Country, Specialists), y = Specialists)) +

  geom_col(fill = "steelblue") +

  coord_flip() +

  scale_y_continuous(labels = comma) +

  labs(

    title = "Top 20 Countries by Number of Specialist Medical Practitioners",

    x = "Country",

    y = "Number of specialist medical practitioners"

  ) +

  theme_minimal()

Figure 2 — Bottom 20 countries by number of specialist medical practitioners

top20 <- prac %>%

  arrange(Specialists) %>%

  slice_head(n = 20)

 

ggplot(top20, aes(x = fct_reorder(Country, Specialists), y = Specialists)) +

  geom_col(fill = "steelblue") +

  coord_flip() +

  scale_y_continuous(labels = comma) +

  labs(

    title = "Bottom 20 Countries by Number of Specialist Medical Practitioners",

    x = "Country",

    y = "Number of specialist medical practitioners"

  ) +

  theme_minimal()

Figure 3 — Distribution of practitioner counts across countries

ggplot(prac, aes(x = Specialists)) +

  geom_histogram(bins = 30, fill = "darkcyan", color = "white") +

  scale_x_continuous(labels = comma) +

  labs(

    title = "Distribution of Specialist Medical Practitioner Counts Across Countries",

    x = "Number of specialist medical practitioners",

    y = "Number of countries"

  ) +

  theme_minimal()

Figure 4 — Regional comparison of counts

region_sum <- prac %>%

  group_by(Region) %>%

  summarise(TotalReported = sum(Specialists, na.rm = TRUE)) %>%

  arrange(desc(TotalReported))

 

ggplot(region_sum, aes(x = fct_reorder(Region, TotalReported), y = TotalReported)) +

  geom_col(fill = "mediumpurple") +

  coord_flip() +

  scale_y_continuous(labels = comma) +

  labs(

    title = "Sum of Reported Country Counts by Region",

    x = "Region",

    y = "Sum of reported country counts"

  ) +

  theme_minimal()

Figure 5 — Spread of country counts within each region

ggplot(prac, aes(x = Region, y = Specialists, fill = Region)) +

  geom_boxplot(show.legend = FALSE) +

  scale_y_continuous(labels = comma) +

  labs(

    title = "Distribution of Specialist Medical Practitioner Counts Within Regions",

    x = "Region",

    y = "Number of specialist medical practitioners"

  ) +

  theme_minimal() +

  theme(axis.text.x = element_text(angle = 30, hjust = 1))

Figure 6 — Number of countries by reporting year

year_count <- prac %>%

  count(Year)

 

ggplot(year_count, aes(x = factor(Year), y = n)) +

  geom_col(fill = "goldenrod") +

  labs(

    title = "Number of Countries by Reporting Year",

    x = "Reporting year",

    y = "Number of countries"

  ) +

  theme_minimal()

Figure 7 — Dot Plot of Top 25 Countries by Specialist Medical Practitioners

dot_data <- prac %>%

  arrange(desc(Specialists)) %>%

  slice_head(n = 25)

 

ggplot(dot_data, aes(x = Specialists, y = fct_reorder(Country, Specialists))) +

  geom_point(color = "darkblue", size = 3) +

  scale_x_continuous(labels = comma) +

  labs(

    title = "Top 25 Countries by Number of Specialist Medical Practitioners",

    x = "Number of specialist medical practitioners",

    y = "Country"

  ) +

  theme_minimal()

Figure 8 — Interactive scatter plot: Year vs count

p <- ggplot(prac, aes(

  x = Year,

  y = Specialists,

  text = paste(

    "Country:", Country,

    "<br>Region:", Region,

    "<br>Year:", Year,

    "<br>Specialists:", comma(Specialists)

  )

)) +

  geom_point(color = "navy", alpha = 0.7, size = 2) +

  scale_y_continuous(labels = comma) +

  labs(

    title = "Interactive View of Specialist Medical Practitioner Counts by Reporting Year",

    x = "Reporting year",

    y = "Number of specialist medical practitioners"

  ) +

  theme_minimal()

 

ggplotly(p, tooltip = "text")