F1-dev-01 — Analytic firm dataset and revenue aggregates
Question
Build a documented one-row-per-firm analytic dataset from the synthetic file data/firms.csv and report: the number of distinct firms, the mean and median revenue in millions of USD over firms with known revenue, and the mean head count over all distinct firms.
Data and exclusions
data/firms.csv has 445 data rows (n_input_rows), 5 columns. Detected problems (data_issues):
- Duplicate rows — 45 rows repeat an earlier row exactly (same firm_id, identical values); none conflict. Kept first occurrence, giving 400 distinct firms (
n_unique_firms). - Mixed revenue units — 60 distinct firms report revenue in
USD_thousands, the rest inUSD_millions. All values were converted to millions USD (thousands ÷ 1000). Converted magnitudes match those of the millions rows, so the unit labels look correct. - Missing revenue — 7 raw rows, i.e. 6 distinct firms (F0048, F0121, F0129, F0269, F0348, F0399), have no revenue (
n_missing_revenue). They are left out of the revenue aggregates andout/analytic.csv, but they still count towardn_unique_firmsandmean_employees.
Exclusion ledger (out/exclusions.csv): 445 → (exact duplicates, −45) → 400 → (unit conversion, −0) → 400 → (missing revenue, −6) → 394 = n_analysed.
Method
This is a deterministic descriptive computation in out/analysis.py, with no randomness (random_seed = null). The baseline mean_revenue_raw is the plain mean of the non-empty revenue values as read, before any cleaning. Mean and median revenue are computed over the 394 analytic firms in millions USD; with an even n, the median is the average of the two middle values. Mean employees is computed over all 400 distinct firms.
Results
- Distinct firms: 400 (
n_unique_firms); firms with missing revenue: 6 (n_missing_revenue); firms analysed: 394 (n_analysed). - Mean revenue: 249.96 M USD (
mean_revenue_musd= 249.9620761421). - Median revenue: 162.306 M USD (
median_revenue_musd). - Mean employees: 1101.435 (
mean_employees). - Baseline raw mean: 30695.88 in mixed file units (
mean_revenue_raw). It is not interpretable, because it mixes thousands and millions and counts duplicate rows twice. Comparing it withmean_revenue_musdshows how large the unit problem is. - Feasibility: complete (
feasibility).
Uncertainty
These figures are exact statistics of the file as provided, not estimates of a wider population, so no sampling standard errors or confidence intervals are reported. The remaining uncertainty is about how the data were handled, not about sampling. It comes from three sources: (i) trusting the row-level unit labels; (ii) the 6 firms with missing revenue — if their revenue is not missing at random, the revenue aggregates could be biased; (iii) treating exact duplicates as assembly errors rather than as separate firms.
Limitations and open issues
- The data are simulated. Unit labels were checked only for plausible magnitudes; mislabelled units within the plausible range cannot be detected.
- No imputation was done for missing revenue, so the revenue aggregates cover 394 of 400 firms.
- Revenue is right-skewed: the mean (249.96) is well above the median (162.306).