Package 'eefirms'

Title: Estonian Company Data for Student Theses
Description: Gives ready-to-use panel data on Estonian companies: revenue, profit, assets, employees and taxes paid, one row per company and year. The data come from the annual reports in the Estonian e-Business Register (2019 onwards) and from the Estonian Tax and Customs Board (2022 onwards). A monthly archive keeps companies that have closed, so that panels do not contain only survivors. Made for students without programming experience: every function works with zero or one argument.
Authors: Renee Pesor [aut, cre]
Maintainer: Renee Pesor <[email protected]>
License: MIT + file LICENSE
Version: 1.1.0
Built: 2026-12-04 21:40:15 UTC
Source: https://github.com/Renkzzz/eefirms

Help Index


Get revenue by activity: one row per company, year and activity

Description

Returns the annual-report annex "revenue by field of activity": how much revenue each company earned in each activity (EMTAK code), with the industry letter (sector). The activity with the largest revenue decides the company's sector in ee_panel(); this table shows all of them, for example to measure diversification.

Usage

ee_activities(years = NULL)

Arguments

years

Which financial years you want, for example 2021:2024. Leave empty for all years.

Value

A table (tibble) sorted by reg_code and year, largest activity first.

Examples

act <- ee_activities(years = 2024)

How to cite the data

Description

Prints a citation for your thesis: the package, the data version (a date), the data sources and their licences, the archive start date for closed companies, and how to load exactly the same data again later.

Usage

ee_cite()

Value

The citation text, invisibly.

Examples

ee_cite()

Get the register history of companies: one row per event

Description

Returns dated events from the e-Business Register: every register entry (founding, amendments, capital changes, mergers, divisions, transformations, liquidation, bankruptcy, deletion, ...) and every change of name, address, capital, legal form and status. Use it for event studies or to date mergers and restructurings. Run table(ee_events()$event) to see all event types.

Usage

ee_events(type = NULL)

Arguments

type

Event type(s) to keep, for example "merger" or c("bankruptcy", "deletion"). Leave empty for all events (several million rows).

Value

A table (tibble) sorted by reg_code and date.

Examples

mergers <- ee_events(type = "merger")

Get revenue by country: one row per company, year and country

Description

Returns the annual-report annex "revenue by geographical area": how much revenue each company earned in each country, including Estonia (country_code "EE"). Only companies that filled in this annex are included. The panel from ee_panel() already has summary columns (export_share, export_eu_share, export_non_eu_share, export_countries, main_export_country).

Usage

ee_exports(years = NULL)

Arguments

years

Which financial years you want, for example 2021:2024. Leave empty for all years.

Details

Some reports give a sum for "other EU countries" or "other non-EU countries" instead of naming every country; these rows have an empty country_code.

Value

A table (tibble) sorted by reg_code and year, largest market first.

Examples

ex <- ee_exports(years = 2024)
ex[ex$country_code %in% "FI", ]

Find companies by name or registry code

Description

Returns one row per company ever seen in the data, including closed companies. Use it to look up a company's registry code (reg_code) and basic facts.

Usage

ee_firms(search = NULL)

Arguments

search

Part of the company name, or the start of a registry code. Upper/lower case and Estonian letters do not matter: "toostus" also finds "Tööstus". Leave empty to get all companies.

Value

A table (tibble), one row per company.

Examples

ee_firms("Telia")
ee_firms("10234957")

Get company owners that are legal entities

Description

Returns the owners of each company that are themselves companies or other legal entities (Estonian or foreign companies, foundations, the state, municipalities): one row per company and owner, with the percent owned. Use it to find parent companies, groups and foreign or state ownership.

Usage

ee_owners()

Details

Owners who are natural persons are never listed by name. They are only counted in ee_firms() (n_owners, owner_foreign_share, ...). Shareholders of public limited companies (AS) are in the register only if the company has a single shareholder, so most ASs have no rows here.

current = FALSE marks owners that have gone from the register since eefirms started following it (see first_seen and last_seen).

Value

A table (tibble) sorted by reg_code, largest owner first.

Examples

own <- ee_owners()
own[own$owner_country != "EE" & own$current, ]

Get the company panel: one row per company per year

Description

Downloads (the first time) and returns the main table: one row for each company and financial year, with annual-report figures, tax data and ready-made ratios such as roa and leverage. Run ee_variables() to see what every column means.

Usage

ee_panel(years = NULL, sector = NULL, all_entities = FALSE)

Arguments

years

Which financial years you want, for example 2021:2024. Leave empty for all years.

sector

Industry letter(s), for example "C" for manufacturing or c("G", "I"). Leave empty for all industries. The letters are listed in the README and in the error message if you type an unknown letter.

all_entities

FALSE (the default) gives business companies only (OÜ, AS, TÜ, UÜ, cooperatives, SE, SCE and branches of foreign companies). TRUE also gives non-profits, foundations, apartment associations and public bodies.

Details

The first call downloads the data, which takes a minute or two. Later calls read the copy saved on your computer and also work without internet.

Value

A table (tibble) sorted by reg_code and year.

See Also

survivorship about closed companies, ee_save() to save the table.

Examples

firms <- ee_panel(years = 2023, sector = "C")
summary(firms$roa)

Get commercial pledges

Description

Returns the commercial pledges in the e-Business Register: a company pledges its movable assets as security for a loan, usually to a bank. One row per pledge and pledgee, with the amount, ranking and dates. The pledgee is named only if it is a legal entity. ee_firms() has the number and total amount of each company's pledges (n_pledges, pledges_amount).

Usage

ee_pledges()

Value

A table (tibble) sorted by reg_code.

Examples

pl <- ee_pledges()
table(pl$pledgee_name)

Save a table to Excel or CSV

Description

Saves any table, for example the result of ee_panel(), as an Excel file (.xlsx) or a CSV file (.csv). The file type follows the ending of the file name. R tells you the full path of the saved file.

Usage

ee_save(data, file)

Arguments

data

The table to save.

file

File name ending in .xlsx or .csv, for example "my_data.xlsx". Without a folder, the file goes to your working directory (see getwd()).

Details

Excel holds at most 1,048,575 rows. For bigger tables, choose fewer years or one sector, or save as .csv.

Value

The full path of the file, invisibly.

Examples

ee_save(data.frame(x = 1:3), file.path(tempdir(), "example.xlsx"))

Get tax data by quarter

Description

Returns data from the Estonian Tax and Customs Board: taxes paid, labour taxes, turnover from VAT returns and the number of employees, one row per company and quarter (from 2022). Only legal entities are included, no sole proprietors.

Usage

ee_taxes(years = NULL)

Arguments

years

Which years you want, for example 2023:2024. Leave empty for all years.

Details

These figures are measured differently from the annual reports: the turnover is from VAT returns, and the employee count is on the last day of the quarter. A blank value (NA) is not the same as zero. The panel from ee_panel() already contains yearly sums of these data (tax_ columns).

Value

A table (tibble) sorted by reg_code, year and quarter.

Examples

tax <- ee_taxes(years = 2024)

What each column means

Description

Prints the data dictionary: every column of every table (ee_panel(), ee_firms(), ee_taxes(), ee_exports(), ee_activities(), ee_owners(), ee_events(), ee_pledges()) with its unit and meaning. Works without internet.

Usage

ee_variables()

Value

The full dictionary as a table (tibble), invisibly. It also has the columns type, source, source_field and notes.

Examples

ee_variables()
vars <- ee_variables()
vars[vars$name == "leverage", "notes"]

Closed companies and survivorship bias

Description

If you study only the companies that still exist, your results look better than reality: the companies that failed are missing. This is called survivorship bias. eefirms keeps closed companies in the data so that you can avoid it.

What you get for closed companies

  • Their annual reports stay in ee_panel(). Closed companies have in_register = FALSE and status = "deleted".

  • When a company closes, the official company list drops its name, county and founding date. eefirms saves this list every month since the archive start (10 April 2025) and never deletes a company. For companies that closed after the archive start you therefore also get name, county, founded, deleted_date and exit_year (the year they closed).

  • deleted_date is approximate: it is the date of the first monthly copy in which the company was missing, so it can be up to about a month late.

Limits (mention them in your thesis)

  • For companies that closed before the archive start, exit_year and deleted_date are empty, and name, county and founded may be empty too. Their annual reports are still included.

  • The Tax and Customs Board removes closed companies from its files, so tax data (tax_ columns and ee_taxes()) of closed companies may be incomplete.

  • A company that stops filing reports but is not yet deleted still has in_register = TRUE. Missing years are not the same as closure.

Studying firm exit

exit_year lets you study which companies close and why, for example:

firms <- ee_panel()
firms$exit <- !is.na(firms$exit_year) & firms$exit_year == firms$year + 1

Because the archive starts in April 2025, exits can be dated from 2025 onwards.

See Also

ee_panel(), ee_cite()