TidyTuesday Section

Explore the week’s TidyTuesday challenge. Develop a research question, then answer it through a short data story with effective visualization(s). Provide sufficient background for readers to grasp your narrative.

Importing the Data Set

Code
library(tidyverse)
library(tidytuesdayR)
library(viridis)

tuesdata <- tt_load("2026-01-27")

companies <- tuesdata$companies
legal_nature <- tuesdata$legal_nature
qualifications <- tuesdata$qualifications
size <- tuesdata$size

Research Question

How is access to high levels of declared capital structured across Brazilian firms, and how do ownership roles and legal form shape capital concentration?

Background

Brazil maintains a public registry of legal entities through the Cadastro Nacional da Pessoa Jurídica (CNPJ), published by the Brazilian Ministry of Finance (Receita Federal). This TidyTuesday dataset is curated from the CNPJ open data and cleaned to focus on firms with meaningful declared capital stock, retaining only companies above a capital threshold.

Declared capital stock represents the financial capital formally reported by a firm and serves as a proxy for economic scale. Companies are categorized by size and legal form, and the dataset also includes information on owner qualifications. This allows us to examine not only which companies hold the highest capital but also how ownership roles and organizational structure relate to capital distribution.

Because the dataset excludes very low-capital firms and capital stock is highly right-skewed, this analysis uses logarithmic scaling and distribution-based visualizations to avoid misleading comparisons. The goal is descriptive: to examine patterns of capital concentration across firm types, ownership, and legal structure.

Main Visualization: Owner qualification vs elite capital status

Code
owner_comparison <- companies %>%
  filter(!is.na(owner_qualification), !is.na(capital_stock), capital_stock > 0) %>%
  mutate(elite_threshold = quantile(capital_stock, 0.90),
    is_elite = if_else(capital_stock >= elite_threshold, "Elite (Top 10%)", "Other Companies")) %>%

  add_count(owner_qualification, name = "owner_count") %>%
  filter(owner_count >= sort(unique(owner_count), decreasing = TRUE)[5]) %>%
  group_by(owner_qualification, is_elite) %>%
  summarise(count = n(), .groups = "drop") %>%
  group_by(is_elite) %>%
  mutate(percent = count / sum(count) * 100)

ggplot(owner_comparison, aes(x = reorder(owner_qualification, percent), y = percent, fill = is_elite)) +
  geom_col(position = "dodge") +
  coord_flip() +
  labs(title = "Distribution of Capital by Owner Qualification",
    subtitle = "Comparing elite (top 10%) and typical Brazilian companies",
    x = "Owner Qualification",
    y = "Share of Companies (%)",
    fill = "Company Type",
    caption = "Source: TidyTuesday (2026-01-27) companies.csv") +
  scale_fill_viridis_d(option = "B")  + 
  theme_minimal()

Summary / Data Story

Our analysis explores how access to high levels of declared capital is structured across Brazilian firms, focusing on the roles of ownership and legal form.

Who controls the capital? The main visualization shows the distribution of owner qualifications in elite (top 10% by capital) versus typical companies. While Managing Partners dominate most firms, elite companies reveal a more diverse leadership composition: Administrators and Managers lead roughly 30% of elite firms compared to under 9% in typical firms, and positions like Directors, Officers, and Presidents are also far more common at the top. This indicates that the highest-capital firms adopt more formalized corporate governance structures, suggesting ownership type is strongly associated with access to substantial capital.

How does legal structure shape capital within small enterprises? Because capital stock is highly right-skewed, values were placed on a log10 scale for meaningful comparison and to avoid the largest firms dominating the plot. The supporting boxplot examines capital stock across legal forms among small enterprises. While most legal categories show similar median capital levels, Limited Liability Companies (LLCs) display a wider distribution and longer right tail, indicating that some LLCs hold much higher capital than their peers. Simpler forms, such as sole proprietorships and partnerships, tend to have narrower ranges and fewer extreme values. This suggests that while legal form does not completely determine capital, it can create opportunities for higher capital accumulation within certain structures.

Key insight: Taken together, these findings suggest that access to high capital in Brazil is structured more by ownership role and organizational form than by formal size classification. Elite capital is concentrated in firms with diverse, professionalized leadership and in legal structures (especially LLCs) that allow for greater financial leverage. Entrepreneurs and policymakers should be aware that both governance and legal framework influence which firms can access the highest levels of capital.