Before describing anything, it establishes which variables are actually fit to use: how much is missing, whether the values are plausible, and which give an unbroken series. The verdict at the end says what may be analysed, what needs a stated period, and what must not be used.
Run 00_setup.Rmd and
01_prepare_data.Rmd first.
load("output/clean/00_setup.RData")
suppressPackageStartupMessages(library(dplyr))
dat <- readRDS("output/clean/pkp_clean.rds")
# The two hierarchy levels are never mixed.
sections <- dat %>% filter(level == "section")
divisions <- dat %>% filter(level == "division")
nrow(sections)
## [1] 3402
nrow(divisions)
## [1] 13608
What this produces. sections = the six
one-letter industry codes (C, G, H, I, J, M). divisions =
the 24 two-digit codes beneath them. The two are kept apart because
section C contains division C26 — adding them together
double-counts.
# Derived indicators - what the analysis actually uses
indicator_vars <- c(
"inv_intensity", "intang_intensity", "tang_intensity", "intang_share",
"sh_compinfo", "sh_innovprop", "sh_econcomp", "sh_nonNA",
"sh_rd", "sh_orgcap", "sh_brand", "sh_train", "sh_design",
"ict_share", "lp_hour", "lp_person", "hours_per_person"
)
# Every variable the team highlighted in Variable-List-Highlighted.xlsx, plus
# the growth-accounting block. These are the shortlist candidates, so all are
# checked.
source_vars <- c(
# output and labour
"VA_CP", "VA_Q", "VAadj", "VAadj_q", "EMP", "H_EMP",
# investment, national accounts basis
"I_GFCF", "I_IT", "I_CT", "I_Soft_DB", "I_RD", "I_OIPP",
# investment, CHS basis
"I_Tang", "I_Intang", "I_NatAcc", "I_NonNatAcc",
"I_Innovprop", "I_EconComp", "I_OrgCap", "I_Brand", "I_Train", "I_Design",
# chained volumes
"Iq_GFCF", "Iq_Tang", "Iq_Intang", "Iq_NatAcc", "Iq_NonNatAcc",
# capital stocks
"K_GFCF", "K_RD", "K_Soft_DB", "K_OIPP", "K_Tang",
"K_NatAcc", "K_NonNatAcc", "K_Innovprop", "K_EconComp",
"K_OrgCap", "K_Brand", "K_Train", "K_Intang", "K_Intang_rebuilt",
# growth accounting
"VAConIntang", "VAConTangICT", "VAConTangNICT", "VAConLC", "VAConTFP"
)
check_vars <- c(source_vars, indicator_vars)
length(check_vars)
## [1] 63
What this produces. source_vars =
variables that came from the database as supplied.
indicator_vars = ratios and shares calculated in
01_prepare_data.Rmd. Both are checked, because a source
variable can be present while the indicator built from it is missing —
which happens when a component is negative and a share becomes
meaningless.
Counts of missing years out of 27, by section. Zero means complete.
si_sec <- sections %>% filter(geo == "SI")
missing_si <- sapply(focus_sections, function(s) {
rows <- si_sec %>% filter(nace == s)
sapply(check_vars, function(v) sum(is.na(rows[[v]])))
})
missing_si
## C G H I J M
## VA_CP 0 0 0 0 0 0
## VA_Q 0 0 0 0 0 0
## VAadj 0 0 0 0 0 0
## VAadj_q 0 0 0 0 0 0
## EMP 0 0 0 0 0 0
## H_EMP 0 0 0 0 0 0
## I_GFCF 0 0 0 0 0 0
## I_IT 0 0 0 0 0 0
## I_CT 0 0 0 0 0 0
## I_Soft_DB 0 0 0 0 0 0
## I_RD 0 2 14 0 0 0
## I_OIPP 0 0 0 0 0 0
## I_Tang 0 0 0 0 0 0
## I_Intang 0 2 14 1 0 1
## I_NatAcc 0 2 14 0 0 0
## I_NonNatAcc 0 0 0 0 0 0
## I_Innovprop 0 2 14 0 0 0
## I_EconComp 0 0 0 0 0 0
## I_OrgCap 0 0 0 0 0 0
## I_Brand 0 0 0 0 0 0
## I_Train 0 0 0 0 0 0
## I_Design 0 0 0 0 0 0
## Iq_GFCF 0 0 0 0 0 0
## Iq_Tang 0 0 0 0 0 0
## Iq_Intang 0 2 21 1 0 1
## Iq_NatAcc 0 2 21 0 0 0
## Iq_NonNatAcc 0 0 0 0 0 0
## K_GFCF 5 5 5 5 5 5
## K_RD 5 5 11 5 5 5
## K_Soft_DB 5 5 5 5 5 5
## K_OIPP 0 0 0 0 0 0
## K_Tang 5 5 5 5 5 5
## K_NatAcc 5 5 11 5 5 5
## K_NonNatAcc 0 0 0 0 0 0
## K_Innovprop 5 5 11 5 5 5
## K_EconComp 0 0 0 0 0 0
## K_OrgCap 0 0 0 0 0 0
## K_Brand 0 0 0 0 0 0
## K_Train 0 0 0 0 0 0
## K_Intang 26 26 26 26 26 26
## K_Intang_rebuilt 5 5 11 5 5 5
## VAConIntang 6 6 11 6 6 6
## VAConTangICT 6 6 11 6 6 6
## VAConTangNICT 6 6 11 6 6 6
## VAConLC 14 14 14 14 14 14
## VAConTFP 14 14 14 14 14 14
## inv_intensity 0 0 0 0 0 0
## intang_intensity 0 2 14 1 0 1
## tang_intensity 0 0 0 0 0 0
## intang_share 0 2 14 1 0 1
## sh_compinfo 0 2 14 1 0 1
## sh_innovprop 0 2 14 1 0 1
## sh_econcomp 0 2 14 1 0 1
## sh_nonNA 0 2 14 1 0 1
## sh_rd 0 2 14 1 0 1
## sh_orgcap 0 2 14 1 0 1
## sh_brand 0 2 14 1 0 1
## sh_train 0 2 14 1 0 1
## sh_design 0 2 14 1 0 1
## ict_share 0 0 0 0 0 0
## lp_hour 0 0 0 0 0 0
## lp_person 0 0 0 0 0 0
## hours_per_person 0 0 0 0 0 0
How to read. Counts of missing years out of 27, by variable (rows) and section (columns), for Slovenia. Zero means complete. A count says how much is missing, not where — the next chunk answers that.
A count says how much is missing, not where. Fourteen missing years at the start of a series is a late start - inconvenient but harmless, and handled by stating the period. Fourteen scattered through the middle is a broken series, and rules out anything measured over time.
Only variables that actually have gaps appear below.
gap_detail <- do.call(rbind, lapply(check_vars, function(v) {
do.call(rbind, lapply(focus_sections, function(s) {
rows <- si_sec %>% filter(nace == s)
miss <- sort(rows$year[ is.na(rows[[v]])])
pres <- sort(rows$year[!is.na(rows[[v]])])
if (length(miss) == 0) return(NULL) # complete - nothing to report
pattern <- if (length(pres) == 0) "no data at all"
else if (all(miss < min(pres))) "starts late"
else if (all(miss > max(pres))) "ends early"
else "INTERNAL GAP"
data.frame(
variable = v,
section = s,
n_missing = length(miss),
first_available = if (length(pres)) min(pres) else NA,
last_available = if (length(pres)) max(pres) else NA,
pattern = pattern,
missing_years = paste(miss, collapse = ", ")
)
}))
}))
gap_detail
## variable section n_missing first_available last_available
## 1 I_RD G 2 1997 2021
## 2 I_RD H 14 2006 2021
## 3 I_Intang G 2 1997 2021
## 4 I_Intang H 14 2006 2021
## 5 I_Intang I 1 1995 2020
## 6 I_Intang M 1 1995 2020
## 7 I_NatAcc G 2 1997 2021
## 8 I_NatAcc H 14 2006 2021
## 9 I_Innovprop G 2 1997 2021
## 10 I_Innovprop H 14 2006 2021
## 11 Iq_Intang G 2 1997 2021
## 12 Iq_Intang H 21 2016 2021
## 13 Iq_Intang I 1 1995 2020
## 14 Iq_Intang M 1 1995 2020
## 15 Iq_NatAcc G 2 1997 2021
## 16 Iq_NatAcc H 21 2016 2021
## 17 K_GFCF C 5 2000 2021
## 18 K_GFCF G 5 2000 2021
## 19 K_GFCF H 5 2000 2021
## 20 K_GFCF I 5 2000 2021
## 21 K_GFCF J 5 2000 2021
## 22 K_GFCF M 5 2000 2021
## 23 K_RD C 5 2000 2021
## 24 K_RD G 5 2000 2021
## 25 K_RD H 11 2006 2021
## 26 K_RD I 5 2000 2021
## 27 K_RD J 5 2000 2021
## 28 K_RD M 5 2000 2021
## 29 K_Soft_DB C 5 2000 2021
## 30 K_Soft_DB G 5 2000 2021
## 31 K_Soft_DB H 5 2000 2021
## 32 K_Soft_DB I 5 2000 2021
## 33 K_Soft_DB J 5 2000 2021
## 34 K_Soft_DB M 5 2000 2021
## 35 K_Tang C 5 2000 2021
## 36 K_Tang G 5 2000 2021
## 37 K_Tang H 5 2000 2021
## 38 K_Tang I 5 2000 2021
## 39 K_Tang J 5 2000 2021
## 40 K_Tang M 5 2000 2021
## 41 K_NatAcc C 5 2000 2021
## 42 K_NatAcc G 5 2000 2021
## 43 K_NatAcc H 11 2006 2021
## 44 K_NatAcc I 5 2000 2021
## 45 K_NatAcc J 5 2000 2021
## 46 K_NatAcc M 5 2000 2021
## 47 K_Innovprop C 5 2000 2021
## 48 K_Innovprop G 5 2000 2021
## 49 K_Innovprop H 11 2006 2021
## 50 K_Innovprop I 5 2000 2021
## 51 K_Innovprop J 5 2000 2021
## 52 K_Innovprop M 5 2000 2021
## 53 K_Intang C 26 2020 2020
## 54 K_Intang G 26 2020 2020
## 55 K_Intang H 26 2020 2020
## 56 K_Intang I 26 2020 2020
## 57 K_Intang J 26 2020 2020
## 58 K_Intang M 26 2020 2020
## 59 K_Intang_rebuilt C 5 2000 2021
## 60 K_Intang_rebuilt G 5 2000 2021
## 61 K_Intang_rebuilt H 11 2006 2021
## 62 K_Intang_rebuilt I 5 2000 2021
## 63 K_Intang_rebuilt J 5 2000 2021
## 64 K_Intang_rebuilt M 5 2000 2021
## 65 VAConIntang C 6 2001 2021
## 66 VAConIntang G 6 2001 2021
## 67 VAConIntang H 11 2006 2021
## 68 VAConIntang I 6 2001 2021
## 69 VAConIntang J 6 2001 2021
## 70 VAConIntang M 6 2001 2021
## 71 VAConTangICT C 6 2001 2021
## 72 VAConTangICT G 6 2001 2021
## 73 VAConTangICT H 11 2006 2021
## 74 VAConTangICT I 6 2001 2021
## 75 VAConTangICT J 6 2001 2021
## 76 VAConTangICT M 6 2001 2021
## 77 VAConTangNICT C 6 2001 2021
## 78 VAConTangNICT G 6 2001 2021
## 79 VAConTangNICT H 11 2006 2021
## 80 VAConTangNICT I 6 2001 2021
## 81 VAConTangNICT J 6 2001 2021
## 82 VAConTangNICT M 6 2001 2021
## 83 VAConLC C 14 2009 2021
## 84 VAConLC G 14 2009 2021
## 85 VAConLC H 14 2009 2021
## 86 VAConLC I 14 2009 2021
## 87 VAConLC J 14 2009 2021
## 88 VAConLC M 14 2009 2021
## 89 VAConTFP C 14 2009 2021
## 90 VAConTFP G 14 2009 2021
## 91 VAConTFP H 14 2009 2021
## 92 VAConTFP I 14 2009 2021
## 93 VAConTFP J 14 2009 2021
## 94 VAConTFP M 14 2009 2021
## 95 intang_intensity G 2 1997 2021
## 96 intang_intensity H 14 2006 2021
## 97 intang_intensity I 1 1995 2020
## 98 intang_intensity M 1 1995 2020
## 99 intang_share G 2 1997 2021
## 100 intang_share H 14 2006 2021
## 101 intang_share I 1 1995 2020
## 102 intang_share M 1 1995 2020
## 103 sh_compinfo G 2 1997 2021
## 104 sh_compinfo H 14 2006 2021
## 105 sh_compinfo I 1 1995 2020
## 106 sh_compinfo M 1 1995 2020
## 107 sh_innovprop G 2 1997 2021
## 108 sh_innovprop H 14 2006 2021
## 109 sh_innovprop I 1 1995 2020
## 110 sh_innovprop M 1 1995 2020
## 111 sh_econcomp G 2 1997 2021
## 112 sh_econcomp H 14 2006 2021
## 113 sh_econcomp I 1 1995 2020
## 114 sh_econcomp M 1 1995 2020
## 115 sh_nonNA G 2 1997 2021
## 116 sh_nonNA H 14 2006 2021
## 117 sh_nonNA I 1 1995 2020
## 118 sh_nonNA M 1 1995 2020
## 119 sh_rd G 2 1997 2021
## 120 sh_rd H 14 2006 2021
## 121 sh_rd I 1 1995 2020
## 122 sh_rd M 1 1995 2020
## 123 sh_orgcap G 2 1997 2021
## 124 sh_orgcap H 14 2006 2021
## 125 sh_orgcap I 1 1995 2020
## 126 sh_orgcap M 1 1995 2020
## 127 sh_brand G 2 1997 2021
## 128 sh_brand H 14 2006 2021
## 129 sh_brand I 1 1995 2020
## 130 sh_brand M 1 1995 2020
## 131 sh_train G 2 1997 2021
## 132 sh_train H 14 2006 2021
## 133 sh_train I 1 1995 2020
## 134 sh_train M 1 1995 2020
## 135 sh_design G 2 1997 2021
## 136 sh_design H 14 2006 2021
## 137 sh_design I 1 1995 2020
## 138 sh_design M 1 1995 2020
## pattern
## 1 starts late
## 2 INTERNAL GAP
## 3 starts late
## 4 INTERNAL GAP
## 5 ends early
## 6 ends early
## 7 starts late
## 8 INTERNAL GAP
## 9 starts late
## 10 INTERNAL GAP
## 11 starts late
## 12 starts late
## 13 ends early
## 14 ends early
## 15 starts late
## 16 starts late
## 17 starts late
## 18 starts late
## 19 starts late
## 20 starts late
## 21 starts late
## 22 starts late
## 23 starts late
## 24 starts late
## 25 starts late
## 26 starts late
## 27 starts late
## 28 starts late
## 29 starts late
## 30 starts late
## 31 starts late
## 32 starts late
## 33 starts late
## 34 starts late
## 35 starts late
## 36 starts late
## 37 starts late
## 38 starts late
## 39 starts late
## 40 starts late
## 41 starts late
## 42 starts late
## 43 starts late
## 44 starts late
## 45 starts late
## 46 starts late
## 47 starts late
## 48 starts late
## 49 starts late
## 50 starts late
## 51 starts late
## 52 starts late
## 53 INTERNAL GAP
## 54 INTERNAL GAP
## 55 INTERNAL GAP
## 56 INTERNAL GAP
## 57 INTERNAL GAP
## 58 INTERNAL GAP
## 59 starts late
## 60 starts late
## 61 starts late
## 62 starts late
## 63 starts late
## 64 starts late
## 65 starts late
## 66 starts late
## 67 starts late
## 68 starts late
## 69 starts late
## 70 starts late
## 71 starts late
## 72 starts late
## 73 starts late
## 74 starts late
## 75 starts late
## 76 starts late
## 77 starts late
## 78 starts late
## 79 starts late
## 80 starts late
## 81 starts late
## 82 starts late
## 83 starts late
## 84 starts late
## 85 starts late
## 86 starts late
## 87 starts late
## 88 starts late
## 89 starts late
## 90 starts late
## 91 starts late
## 92 starts late
## 93 starts late
## 94 starts late
## 95 starts late
## 96 INTERNAL GAP
## 97 ends early
## 98 ends early
## 99 starts late
## 100 INTERNAL GAP
## 101 ends early
## 102 ends early
## 103 starts late
## 104 INTERNAL GAP
## 105 ends early
## 106 ends early
## 107 starts late
## 108 INTERNAL GAP
## 109 ends early
## 110 ends early
## 111 starts late
## 112 INTERNAL GAP
## 113 ends early
## 114 ends early
## 115 starts late
## 116 INTERNAL GAP
## 117 ends early
## 118 ends early
## 119 starts late
## 120 INTERNAL GAP
## 121 ends early
## 122 ends early
## 123 starts late
## 124 INTERNAL GAP
## 125 ends early
## 126 ends early
## 127 starts late
## 128 INTERNAL GAP
## 129 ends early
## 130 ends early
## 131 starts late
## 132 INTERNAL GAP
## 133 ends early
## 134 ends early
## 135 starts late
## 136 INTERNAL GAP
## 137 ends early
## 138 ends early
## missing_years
## 1 1995, 1996
## 2 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 3 1995, 1996
## 4 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 5 2021
## 6 2021
## 7 1995, 1996
## 8 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 9 1995, 1996
## 10 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 11 1995, 1996
## 12 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
## 13 2021
## 14 2021
## 15 1995, 1996
## 16 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
## 17 1995, 1996, 1997, 1998, 1999
## 18 1995, 1996, 1997, 1998, 1999
## 19 1995, 1996, 1997, 1998, 1999
## 20 1995, 1996, 1997, 1998, 1999
## 21 1995, 1996, 1997, 1998, 1999
## 22 1995, 1996, 1997, 1998, 1999
## 23 1995, 1996, 1997, 1998, 1999
## 24 1995, 1996, 1997, 1998, 1999
## 25 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
## 26 1995, 1996, 1997, 1998, 1999
## 27 1995, 1996, 1997, 1998, 1999
## 28 1995, 1996, 1997, 1998, 1999
## 29 1995, 1996, 1997, 1998, 1999
## 30 1995, 1996, 1997, 1998, 1999
## 31 1995, 1996, 1997, 1998, 1999
## 32 1995, 1996, 1997, 1998, 1999
## 33 1995, 1996, 1997, 1998, 1999
## 34 1995, 1996, 1997, 1998, 1999
## 35 1995, 1996, 1997, 1998, 1999
## 36 1995, 1996, 1997, 1998, 1999
## 37 1995, 1996, 1997, 1998, 1999
## 38 1995, 1996, 1997, 1998, 1999
## 39 1995, 1996, 1997, 1998, 1999
## 40 1995, 1996, 1997, 1998, 1999
## 41 1995, 1996, 1997, 1998, 1999
## 42 1995, 1996, 1997, 1998, 1999
## 43 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
## 44 1995, 1996, 1997, 1998, 1999
## 45 1995, 1996, 1997, 1998, 1999
## 46 1995, 1996, 1997, 1998, 1999
## 47 1995, 1996, 1997, 1998, 1999
## 48 1995, 1996, 1997, 1998, 1999
## 49 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
## 50 1995, 1996, 1997, 1998, 1999
## 51 1995, 1996, 1997, 1998, 1999
## 52 1995, 1996, 1997, 1998, 1999
## 53 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021
## 54 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021
## 55 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021
## 56 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021
## 57 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021
## 58 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021
## 59 1995, 1996, 1997, 1998, 1999
## 60 1995, 1996, 1997, 1998, 1999
## 61 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
## 62 1995, 1996, 1997, 1998, 1999
## 63 1995, 1996, 1997, 1998, 1999
## 64 1995, 1996, 1997, 1998, 1999
## 65 1995, 1996, 1997, 1998, 1999, 2000
## 66 1995, 1996, 1997, 1998, 1999, 2000
## 67 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
## 68 1995, 1996, 1997, 1998, 1999, 2000
## 69 1995, 1996, 1997, 1998, 1999, 2000
## 70 1995, 1996, 1997, 1998, 1999, 2000
## 71 1995, 1996, 1997, 1998, 1999, 2000
## 72 1995, 1996, 1997, 1998, 1999, 2000
## 73 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
## 74 1995, 1996, 1997, 1998, 1999, 2000
## 75 1995, 1996, 1997, 1998, 1999, 2000
## 76 1995, 1996, 1997, 1998, 1999, 2000
## 77 1995, 1996, 1997, 1998, 1999, 2000
## 78 1995, 1996, 1997, 1998, 1999, 2000
## 79 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
## 80 1995, 1996, 1997, 1998, 1999, 2000
## 81 1995, 1996, 1997, 1998, 1999, 2000
## 82 1995, 1996, 1997, 1998, 1999, 2000
## 83 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
## 84 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
## 85 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
## 86 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
## 87 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
## 88 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
## 89 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
## 90 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
## 91 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
## 92 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
## 93 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
## 94 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
## 95 1995, 1996
## 96 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 97 2021
## 98 2021
## 99 1995, 1996
## 100 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 101 2021
## 102 2021
## 103 1995, 1996
## 104 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 105 2021
## 106 2021
## 107 1995, 1996
## 108 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 109 2021
## 110 2021
## 111 1995, 1996
## 112 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 113 2021
## 114 2021
## 115 1995, 1996
## 116 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 117 2021
## 118 2021
## 119 1995, 1996
## 120 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 121 2021
## 122 2021
## 123 1995, 1996
## 124 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 125 2021
## 126 2021
## 127 1995, 1996
## 128 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 129 2021
## 130 2021
## 131 1995, 1996
## 132 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 133 2021
## 134 2021
## 135 1995, 1996
## 136 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 137 2021
## 138 2021
Columns. n_missing = how many years
have no value. first_available /
last_available = the range that does have data.
pattern classifies the gap: starts late (the
series simply begins later — state the period and move on),
ends early, INTERNAL GAP (holes in the middle,
which rules out anything measured continuously over time),
no data at all. missing_years lists the actual
years. Only variables with gaps appear.
# = data present, . = missing. One row per
variable and section, so a gap is visible at a glance rather than read
out of a table.
Variables that are complete in every section are listed underneath rather than drawn, to keep the map short.
years <- 1995:2021
coverage_string <- function(present_years) {
paste(ifelse(years %in% present_years, "#", "."), collapse = "")
}
# Build the map for every variable and section
map_rows <- do.call(rbind, lapply(check_vars, function(v) {
do.call(rbind, lapply(focus_sections, function(s) {
rows <- si_sec %>% filter(nace == s)
pres <- rows$year[!is.na(rows[[v]])]
data.frame(variable = v, section = s,
bar = coverage_string(pres), n = length(pres),
stringsAsFactors = FALSE)
}))
}))
# Split into complete and incomplete
complete_vars <- map_rows %>%
group_by(variable) %>%
summarise(all_full = all(n == 27), .groups = "drop") %>%
filter(all_full) %>% pull(variable)
gappy <- map_rows %>% filter(!variable %in% complete_vars)
# --- year ruler ---
ticks <- rep(" ", 27); ticks[seq(1, 27, by = 5)] <- "|"
lab <- rep(" ", 27)
for (k in seq_along(seq(1, 27, by = 5))) {
pos <- seq(1, 27, by = 5)[k]
two <- c("95", "00", "05", "10", "15", "20")[k]
lab[pos] <- substr(two, 1, 1)
if (pos + 1 <= 27) lab[pos + 1] <- substr(two, 2, 2)
}
cat(sprintf("%-18s %-3s %s\n", "", "", paste(lab, collapse = "")))
## 95 00 05 10 15 20
cat(sprintf("%-18s %-3s %s n\n", "variable", "sec", paste(ticks, collapse = "")))
## variable sec | | | | | | n
cat(strrep("-", 52), "\n")
## ----------------------------------------------------
last_v <- ""
for (i in seq_len(nrow(gappy))) {
vname <- if (gappy$variable[i] == last_v) "" else gappy$variable[i]
if (vname != "" && i > 1) cat("\n")
cat(sprintf("%-18s %-3s %s %2d\n",
vname, gappy$section[i], gappy$bar[i], gappy$n[i]))
last_v <- gappy$variable[i]
}
## I_RD C ########################### 27
## G ..######################### 25
## H ...........##.####..####### 13
## I ########################### 27
## J ########################### 27
## M ########################### 27
##
## I_Intang C ########################### 27
## G ..######################### 25
## H ...........##.####..####### 13
## I ##########################. 26
## J ########################### 27
## M ##########################. 26
##
## I_NatAcc C ########################### 27
## G ..######################### 25
## H ...........##.####..####### 13
## I ########################### 27
## J ########################### 27
## M ########################### 27
##
## I_Innovprop C ########################### 27
## G ..######################### 25
## H ...........##.####..####### 13
## I ########################### 27
## J ########################### 27
## M ########################### 27
##
## Iq_Intang C ########################### 27
## G ..######################### 25
## H .....................###### 6
## I ##########################. 26
## J ########################### 27
## M ##########################. 26
##
## Iq_NatAcc C ########################### 27
## G ..######################### 25
## H .....................###### 6
## I ########################### 27
## J ########################### 27
## M ########################### 27
##
## K_GFCF C .....###################### 22
## G .....###################### 22
## H .....###################### 22
## I .....###################### 22
## J .....###################### 22
## M .....###################### 22
##
## K_RD C .....###################### 22
## G .....###################### 22
## H ...........################ 16
## I .....###################### 22
## J .....###################### 22
## M .....###################### 22
##
## K_Soft_DB C .....###################### 22
## G .....###################### 22
## H .....###################### 22
## I .....###################### 22
## J .....###################### 22
## M .....###################### 22
##
## K_Tang C .....###################### 22
## G .....###################### 22
## H .....###################### 22
## I .....###################### 22
## J .....###################### 22
## M .....###################### 22
##
## K_NatAcc C .....###################### 22
## G .....###################### 22
## H ...........################ 16
## I .....###################### 22
## J .....###################### 22
## M .....###################### 22
##
## K_Innovprop C .....###################### 22
## G .....###################### 22
## H ...........################ 16
## I .....###################### 22
## J .....###################### 22
## M .....###################### 22
##
## K_Intang C .........................#. 1
## G .........................#. 1
## H .........................#. 1
## I .........................#. 1
## J .........................#. 1
## M .........................#. 1
##
## K_Intang_rebuilt C .....###################### 22
## G .....###################### 22
## H ...........################ 16
## I .....###################### 22
## J .....###################### 22
## M .....###################### 22
##
## VAConIntang C ......##################### 21
## G ......##################### 21
## H ...........################ 16
## I ......##################### 21
## J ......##################### 21
## M ......##################### 21
##
## VAConTangICT C ......##################### 21
## G ......##################### 21
## H ...........################ 16
## I ......##################### 21
## J ......##################### 21
## M ......##################### 21
##
## VAConTangNICT C ......##################### 21
## G ......##################### 21
## H ...........################ 16
## I ......##################### 21
## J ......##################### 21
## M ......##################### 21
##
## VAConLC C ..............############# 13
## G ..............############# 13
## H ..............############# 13
## I ..............############# 13
## J ..............############# 13
## M ..............############# 13
##
## VAConTFP C ..............############# 13
## G ..............############# 13
## H ..............############# 13
## I ..............############# 13
## J ..............############# 13
## M ..............############# 13
##
## intang_intensity C ########################### 27
## G ..######################### 25
## H ...........##.####..####### 13
## I ##########################. 26
## J ########################### 27
## M ##########################. 26
##
## intang_share C ########################### 27
## G ..######################### 25
## H ...........##.####..####### 13
## I ##########################. 26
## J ########################### 27
## M ##########################. 26
##
## sh_compinfo C ########################### 27
## G ..######################### 25
## H ...........##.####..####### 13
## I ##########################. 26
## J ########################### 27
## M ##########################. 26
##
## sh_innovprop C ########################### 27
## G ..######################### 25
## H ...........##.####..####### 13
## I ##########################. 26
## J ########################### 27
## M ##########################. 26
##
## sh_econcomp C ########################### 27
## G ..######################### 25
## H ...........##.####..####### 13
## I ##########################. 26
## J ########################### 27
## M ##########################. 26
##
## sh_nonNA C ########################### 27
## G ..######################### 25
## H ...........##.####..####### 13
## I ##########################. 26
## J ########################### 27
## M ##########################. 26
##
## sh_rd C ########################### 27
## G ..######################### 25
## H ...........##.####..####### 13
## I ##########################. 26
## J ########################### 27
## M ##########################. 26
##
## sh_orgcap C ########################### 27
## G ..######################### 25
## H ...........##.####..####### 13
## I ##########################. 26
## J ########################### 27
## M ##########################. 26
##
## sh_brand C ########################### 27
## G ..######################### 25
## H ...........##.####..####### 13
## I ##########################. 26
## J ########################### 27
## M ##########################. 26
##
## sh_train C ########################### 27
## G ..######################### 25
## H ...........##.####..####### 13
## I ##########################. 26
## J ########################### 27
## M ##########################. 26
##
## sh_design C ########################### 27
## G ..######################### 25
## H ...........##.####..####### 13
## I ##########################. 26
## J ########################### 27
## M ##########################. 26
cat("\n", strrep("-", 52), "\n")
##
## ----------------------------------------------------
cat("complete in all six sections (27/27):\n ")
## complete in all six sections (27/27):
##
cat(paste(complete_vars, collapse = ", "), "\n")
## EMP, H_EMP, I_Brand, I_CT, I_Design, I_EconComp, I_GFCF, I_IT, I_NonNatAcc, I_OIPP, I_OrgCap, I_Soft_DB, I_Tang, I_Train, Iq_GFCF, Iq_NonNatAcc, Iq_Tang, K_Brand, K_EconComp, K_NonNatAcc, K_OIPP, K_OrgCap, K_Train, VA_CP, VA_Q, VAadj, VAadj_q, hours_per_person, ict_share, inv_intensity, lp_hour, lp_person, tang_intensity
How to read. A visual version of the same information — one line per variable, one character per year from 1995 to 2021.
An internal gap is the serious case. A late start only needs the period stating.
table(gap_detail$pattern)
##
## ends early INTERNAL GAP starts late
## 26 21 91
internal <- gap_detail %>% filter(pattern == "INTERNAL GAP")
if (nrow(internal) == 0) {
cat("No internal gaps. Every gap is a late start or an early end,\n")
cat("so each series is unbroken within the years it covers.\n")
} else {
internal
}
## variable section n_missing first_available last_available
## 1 I_RD H 14 2006 2021
## 2 I_Intang H 14 2006 2021
## 3 I_NatAcc H 14 2006 2021
## 4 I_Innovprop H 14 2006 2021
## 5 K_Intang C 26 2020 2020
## 6 K_Intang G 26 2020 2020
## 7 K_Intang H 26 2020 2020
## 8 K_Intang I 26 2020 2020
## 9 K_Intang J 26 2020 2020
## 10 K_Intang M 26 2020 2020
## 11 intang_intensity H 14 2006 2021
## 12 intang_share H 14 2006 2021
## 13 sh_compinfo H 14 2006 2021
## 14 sh_innovprop H 14 2006 2021
## 15 sh_econcomp H 14 2006 2021
## 16 sh_nonNA H 14 2006 2021
## 17 sh_rd H 14 2006 2021
## 18 sh_orgcap H 14 2006 2021
## 19 sh_brand H 14 2006 2021
## 20 sh_train H 14 2006 2021
## 21 sh_design H 14 2006 2021
## pattern
## 1 INTERNAL GAP
## 2 INTERNAL GAP
## 3 INTERNAL GAP
## 4 INTERNAL GAP
## 5 INTERNAL GAP
## 6 INTERNAL GAP
## 7 INTERNAL GAP
## 8 INTERNAL GAP
## 9 INTERNAL GAP
## 10 INTERNAL GAP
## 11 INTERNAL GAP
## 12 INTERNAL GAP
## 13 INTERNAL GAP
## 14 INTERNAL GAP
## 15 INTERNAL GAP
## 16 INTERNAL GAP
## 17 INTERNAL GAP
## 18 INTERNAL GAP
## 19 INTERNAL GAP
## 20 INTERNAL GAP
## 21 INTERNAL GAP
## missing_years
## 1 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 2 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 3 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 4 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 5 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021
## 6 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021
## 7 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021
## 8 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021
## 9 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021
## 10 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021
## 11 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 12 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 13 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 14 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 15 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 16 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 17 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 18 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 19 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 20 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
## 21 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2013, 2014
How to read. A count of each gap pattern. Internal gaps are the serious case: a late start only needs the period stating, but holes in the middle break any time series.
The single most useful summary: the first year available for each variable, in the worst-covered section. This is the period the chapter can honestly claim.
first_year_tbl <- do.call(rbind, lapply(check_vars, function(v) {
starts <- sapply(focus_sections, function(s) {
rows <- si_sec %>% filter(nace == s)
pres <- rows$year[!is.na(rows[[v]])]
if (length(pres)) min(pres) else NA_integer_
})
data.frame(variable = v,
earliest = suppressWarnings(min(starts, na.rm = TRUE)),
latest_start = suppressWarnings(max(starts, na.rm = TRUE)),
same_for_all = length(unique(starts)) == 1)
}))
first_year_tbl
## variable earliest latest_start same_for_all
## 1 VA_CP 1995 1995 TRUE
## 2 VA_Q 1995 1995 TRUE
## 3 VAadj 1995 1995 TRUE
## 4 VAadj_q 1995 1995 TRUE
## 5 EMP 1995 1995 TRUE
## 6 H_EMP 1995 1995 TRUE
## 7 I_GFCF 1995 1995 TRUE
## 8 I_IT 1995 1995 TRUE
## 9 I_CT 1995 1995 TRUE
## 10 I_Soft_DB 1995 1995 TRUE
## 11 I_RD 1995 2006 FALSE
## 12 I_OIPP 1995 1995 TRUE
## 13 I_Tang 1995 1995 TRUE
## 14 I_Intang 1995 2006 FALSE
## 15 I_NatAcc 1995 2006 FALSE
## 16 I_NonNatAcc 1995 1995 TRUE
## 17 I_Innovprop 1995 2006 FALSE
## 18 I_EconComp 1995 1995 TRUE
## 19 I_OrgCap 1995 1995 TRUE
## 20 I_Brand 1995 1995 TRUE
## 21 I_Train 1995 1995 TRUE
## 22 I_Design 1995 1995 TRUE
## 23 Iq_GFCF 1995 1995 TRUE
## 24 Iq_Tang 1995 1995 TRUE
## 25 Iq_Intang 1995 2016 FALSE
## 26 Iq_NatAcc 1995 2016 FALSE
## 27 Iq_NonNatAcc 1995 1995 TRUE
## 28 K_GFCF 2000 2000 TRUE
## 29 K_RD 2000 2006 FALSE
## 30 K_Soft_DB 2000 2000 TRUE
## 31 K_OIPP 1995 1995 TRUE
## 32 K_Tang 2000 2000 TRUE
## 33 K_NatAcc 2000 2006 FALSE
## 34 K_NonNatAcc 1995 1995 TRUE
## 35 K_Innovprop 2000 2006 FALSE
## 36 K_EconComp 1995 1995 TRUE
## 37 K_OrgCap 1995 1995 TRUE
## 38 K_Brand 1995 1995 TRUE
## 39 K_Train 1995 1995 TRUE
## 40 K_Intang 2020 2020 TRUE
## 41 K_Intang_rebuilt 2000 2006 FALSE
## 42 VAConIntang 2001 2006 FALSE
## 43 VAConTangICT 2001 2006 FALSE
## 44 VAConTangNICT 2001 2006 FALSE
## 45 VAConLC 2009 2009 TRUE
## 46 VAConTFP 2009 2009 TRUE
## 47 inv_intensity 1995 1995 TRUE
## 48 intang_intensity 1995 2006 FALSE
## 49 tang_intensity 1995 1995 TRUE
## 50 intang_share 1995 2006 FALSE
## 51 sh_compinfo 1995 2006 FALSE
## 52 sh_innovprop 1995 2006 FALSE
## 53 sh_econcomp 1995 2006 FALSE
## 54 sh_nonNA 1995 2006 FALSE
## 55 sh_rd 1995 2006 FALSE
## 56 sh_orgcap 1995 2006 FALSE
## 57 sh_brand 1995 2006 FALSE
## 58 sh_train 1995 2006 FALSE
## 59 sh_design 1995 2006 FALSE
## 60 ict_share 1995 1995 TRUE
## 61 lp_hour 1995 1995 TRUE
## 62 lp_person 1995 1995 TRUE
## 63 hours_per_person 1995 1995 TRUE
Columns. earliest = the first year the
variable exists in any section. latest_start = the first
year it exists in every section — this is the year from
which the chapter can honestly claim coverage for all six industries.
same_for_all = whether every section begins in the same
year.
Counts of missing observations out of 162 (6 sections x 27 years). This decides which peers can support which comparison.
missing_geo <- sapply(sort(unique(sections$geo)), function(g) {
rows <- sections %>% filter(geo == g)
sapply(check_vars, function(v) sum(is.na(rows[[v]])))
})
missing_geo
## AT BG CZ DE DK ES EU11 FI FR IT JP LT LU LV NL RO SE SI
## VA_CP 0 0 0 0 0 0 0 0 0 0 27 0 0 0 0 0 0 0
## VA_Q 0 0 0 0 0 0 0 0 0 0 27 0 0 0 0 0 0 0
## VAadj 0 0 0 0 0 0 162 0 0 0 0 0 0 0 0 0 0 0
## VAadj_q 0 0 0 0 0 0 162 0 0 0 26 0 0 0 0 0 0 0
## EMP 0 0 0 0 0 0 0 0 0 0 27 0 0 0 0 0 0 0
## H_EMP 0 0 0 0 0 0 0 0 0 0 27 0 0 0 0 0 0 0
## I_GFCF 0 0 0 0 0 0 0 0 0 0 32 0 0 0 0 0 0 0
## I_IT 0 18 0 0 0 0 0 0 0 0 32 0 0 0 0 0 0 0
## I_CT 0 18 0 0 0 0 0 0 0 0 32 0 0 0 0 0 0 0
## I_Soft_DB 0 18 0 0 0 0 0 0 0 0 27 0 0 0 0 0 0 0
## I_RD 0 18 0 0 0 0 162 0 0 0 27 22 0 0 0 0 0 16
## I_OIPP 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## I_Tang 0 18 0 0 0 0 162 0 0 0 32 0 0 0 0 0 0 0
## I_Intang 0 18 0 0 0 0 162 0 0 0 27 31 0 0 0 0 0 18
## I_NatAcc 0 18 0 0 0 0 162 0 0 0 27 22 0 0 0 0 0 16
## I_NonNatAcc 0 0 0 0 0 0 162 0 0 0 27 0 0 0 0 0 0 0
## I_Innovprop 0 18 0 0 0 0 162 0 0 0 27 31 0 0 0 0 0 16
## I_EconComp 0 0 0 0 0 0 162 0 0 0 27 0 0 0 0 0 0 0
## I_OrgCap 0 0 0 0 0 0 162 0 0 0 27 0 0 0 0 0 0 0
## I_Brand 0 0 0 0 0 0 162 0 0 0 27 0 0 0 0 0 0 0
## I_Train 0 0 0 0 0 0 162 0 0 0 27 0 0 0 0 0 0 0
## I_Design 0 0 0 0 0 0 162 0 0 0 27 0 0 0 0 0 0 0
## Iq_GFCF 0 0 0 0 0 0 0 0 0 0 32 0 0 0 0 0 0 0
## Iq_Tang 0 162 0 0 0 0 162 0 0 0 32 0 0 0 0 0 0 0
## Iq_Intang 0 162 0 0 0 0 162 0 0 0 27 60 0 0 0 0 0 25
## Iq_NatAcc 0 18 0 0 0 0 162 0 0 0 27 33 1 0 0 4 0 23
## Iq_NonNatAcc 0 0 0 0 0 0 162 0 0 0 27 0 0 0 0 0 0 0
## K_GFCF 0 156 0 0 0 0 0 0 0 0 32 0 0 0 0 30 0 30
## K_RD 0 30 0 0 0 0 0 0 0 0 27 20 0 0 0 96 0 36
## K_Soft_DB 0 162 0 0 0 0 0 0 0 0 27 0 0 0 0 30 0 30
## K_OIPP 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## K_Tang 0 162 0 0 0 0 162 0 0 0 32 0 0 0 0 162 0 30
## K_NatAcc 0 162 0 0 0 0 162 0 0 0 27 20 0 0 0 96 0 36
## K_NonNatAcc 0 0 0 0 0 0 162 0 0 0 162 0 0 0 0 0 0 0
## K_Innovprop 162 30 27 0 0 0 162 0 0 0 27 69 27 108 0 118 27 36
## K_EconComp 0 0 0 0 0 0 162 0 0 0 162 0 0 0 0 0 0 0
## K_OrgCap 0 0 0 0 0 0 162 0 0 0 27 0 0 0 0 0 0 0
## K_Brand 0 0 0 0 0 0 162 0 0 0 27 0 0 0 0 0 0 0
## K_Train 0 0 0 0 0 0 162 0 0 0 27 0 0 0 0 0 0 0
## K_Intang 162 162 27 0 0 0 162 0 0 0 27 69 27 108 0 118 27 156
## K_Intang_rebuilt 0 162 0 0 0 0 162 0 0 0 162 20 0 0 0 96 0 36
## VAConIntang 6 162 6 6 8 6 6 6 6 6 0 22 6 32 6 162 6 41
## VAConTangICT 6 162 6 6 7 6 6 6 6 6 32 22 6 6 6 162 6 41
## VAConTangNICT 6 162 6 6 7 6 6 6 6 6 32 22 6 6 6 162 6 41
## VAConLC 6 162 6 6 7 6 84 6 6 6 32 84 84 84 6 162 6 84
## VAConTFP 6 162 6 6 8 6 84 6 6 6 32 84 84 97 6 162 6 84
## inv_intensity 0 0 0 0 0 0 0 0 0 0 32 0 0 0 0 0 0 0
## intang_intensity 0 18 0 0 0 0 162 0 0 0 27 31 0 0 0 0 0 18
## tang_intensity 0 18 0 0 0 0 162 0 0 0 32 0 0 0 0 0 0 0
## intang_share 0 19 0 0 0 0 162 0 0 0 32 31 0 0 0 0 0 18
## sh_compinfo 0 18 0 0 0 2 162 0 0 0 27 31 2 0 0 0 0 18
## sh_innovprop 0 18 0 0 0 0 162 0 0 0 27 31 0 0 0 0 0 18
## sh_econcomp 0 18 0 0 0 2 162 0 0 0 27 31 0 0 0 0 0 18
## sh_nonNA 0 58 0 0 0 2 162 0 0 0 27 31 0 0 0 1 0 18
## sh_rd 0 18 0 0 0 0 162 0 0 0 27 31 1 0 0 0 0 18
## sh_orgcap 0 18 0 0 0 0 162 0 0 0 27 31 0 0 0 0 0 18
## sh_brand 0 18 0 0 0 0 162 0 0 0 27 31 0 0 0 0 0 18
## sh_train 0 18 0 0 0 0 162 0 0 0 27 31 0 0 0 0 0 18
## sh_design 0 18 0 0 0 0 162 0 0 0 27 31 0 0 0 0 0 18
## ict_share 0 18 0 0 0 1 0 0 0 0 32 0 1 0 0 0 0 0
## lp_hour 0 0 0 0 0 0 162 0 0 0 27 0 0 0 0 0 0 0
## lp_person 0 0 0 0 0 0 162 0 0 0 27 0 0 0 0 0 0 0
## hours_per_person 0 0 0 0 0 0 0 0 0 0 27 0 0 0 0 0 0 0
## SK UK US
## VA_CP 0 0 0
## VA_Q 0 0 0
## VAadj 0 0 0
## VAadj_q 0 0 0
## EMP 0 0 0
## H_EMP 0 0 0
## I_GFCF 0 0 0
## I_IT 0 0 0
## I_CT 0 0 0
## I_Soft_DB 0 0 0
## I_RD 0 0 0
## I_OIPP 0 0 0
## I_Tang 0 0 0
## I_Intang 0 0 0
## I_NatAcc 0 0 0
## I_NonNatAcc 0 0 0
## I_Innovprop 0 0 0
## I_EconComp 0 0 0
## I_OrgCap 0 0 0
## I_Brand 0 0 0
## I_Train 0 0 0
## I_Design 0 0 0
## Iq_GFCF 0 0 0
## Iq_Tang 0 0 0
## Iq_Intang 0 0 0
## Iq_NatAcc 0 0 0
## Iq_NonNatAcc 0 0 0
## K_GFCF 30 0 0
## K_RD 30 0 0
## K_Soft_DB 30 0 0
## K_OIPP 0 0 0
## K_Tang 30 0 0
## K_NatAcc 30 0 0
## K_NonNatAcc 0 0 0
## K_Innovprop 30 0 0
## K_EconComp 0 0 0
## K_OrgCap 0 0 0
## K_Brand 0 0 0
## K_Train 0 0 0
## K_Intang 30 0 0
## K_Intang_rebuilt 30 0 0
## VAConIntang 53 6 12
## VAConTangICT 54 6 12
## VAConTangNICT 53 6 12
## VAConLC 48 12 12
## VAConTFP 54 12 12
## inv_intensity 0 0 0
## intang_intensity 0 0 0
## tang_intensity 0 0 0
## intang_share 0 0 0
## sh_compinfo 1 0 0
## sh_innovprop 0 0 0
## sh_econcomp 0 0 0
## sh_nonNA 3 0 0
## sh_rd 6 0 0
## sh_orgcap 0 0 0
## sh_brand 0 0 0
## sh_train 0 0 0
## sh_design 0 0 0
## ict_share 0 0 0
## lp_hour 0 0 0
## lp_person 0 0 0
## hours_per_person 0 0 0
How to read. Counts of missing observations out of 162 (6 sections × 27 years), by variable and country. This decides which peers can support which comparison — a variable complete for Slovenia is useless for RQ2 if the comparators lack it.
Summary statistics across all sections and countries. The point is not the averages but the minimum and maximum - an impossible value shows up there.
summary_tbl <- do.call(rbind, lapply(check_vars, function(v) {
x <- sections[[v]]
data.frame(
variable = v,
n = sum(!is.na(x)),
missing = sum(is.na(x)),
min = ifelse(all(is.na(x)), NA, min(x, na.rm = TRUE)),
median = ifelse(all(is.na(x)), NA, median(x, na.rm = TRUE)),
max = ifelse(all(is.na(x)), NA, max(x, na.rm = TRUE)),
negative = sum(x < 0, na.rm = TRUE),
zero = sum(x == 0, na.rm = TRUE)
)
}))
summary_tbl$min <- round(summary_tbl$min, 2)
summary_tbl$median <- round(summary_tbl$median, 2)
summary_tbl$max <- round(summary_tbl$max, 2)
summary_tbl
## variable n missing min median max negative zero
## 1 VA_CP 3375 27 18.50 42821.70 127380180.00 0 0
## 2 VA_Q 3375 27 108.51 51204.07 117103679.08 0 0
## 3 VAadj 3240 162 0.00 39747.96 132526336.81 0 27
## 4 VAadj_q 3214 188 0.00 49426.73 120434198.46 0 1
## 5 EMP 3375 27 5.47 419.84 22785900.00 0 0
## 6 H_EMP 3375 27 8962.00 673558.00 39978995.90 0 0
## 7 I_GFCF 3370 32 -223.00 7392.50 39194200.00 1 0
## 8 I_IT 3352 50 -0.50 225.35 2450153.62 1 185
## 9 I_CT 3352 50 -18.10 121.00 2712553.51 10 168
## 10 I_Soft_DB 3357 45 -989.20 612.88 2836800.00 5 157
## 11 I_RD 3157 245 -43.10 96.90 14050600.00 7 564
## 12 I_OIPP 3402 0 -277.91 0.00 669600.00 14 2495
## 13 I_Tang 3190 212 -39.20 4209.55 23211300.00 1 0
## 14 I_Intang 3146 256 0.70 3432.48 20207301.75 0 0
## 15 I_NatAcc 3157 245 -911.60 820.00 16445700.00 5 156
## 16 I_NonNatAcc 3213 189 0.70 2304.83 5165376.12 0 0
## 17 I_Innovprop 3148 254 0.03 576.24 15390793.97 0 0
## 18 I_EconComp 3213 189 0.53 1948.77 3092262.46 0 0
## 19 I_OrgCap 3213 189 0.37 774.36 1112372.83 0 0
## 20 I_Brand 3213 189 0.14 524.57 1793090.17 0 0
## 21 I_Train 3213 189 0.03 381.75 487546.98 0 0
## 22 I_Design 3213 189 0.03 244.99 2279977.10 0 0
## 23 Iq_GFCF 3370 32 -254.34 8808.25 39036172.30 1 0
## 24 Iq_Tang 3046 356 4.38 5457.71 22614441.75 0 0
## 25 Iq_Intang 2966 436 14.60 5403.18 20652465.84 0 0
## 26 Iq_NatAcc 3134 268 -948.59 1016.40 16422925.81 5 156
## 27 Iq_NonNatAcc 3213 189 5.13 2718.66 5205657.17 0 0
## 28 K_GFCF 3124 278 0.00 80084.23 290413751.45 0 6
## 29 K_RD 3163 239 0.00 844.50 85674276.60 0 251
## 30 K_Soft_DB 3123 279 0.00 1846.00 8683059.81 0 4
## 31 K_OIPP 3402 0 0.00 0.00 3872295.58 0 2565
## 32 K_Tang 2824 578 127.80 50112.00 200636191.38 0 0
## 33 K_NatAcc 2869 533 0.00 3528.00 93571593.54 0 4
## 34 K_NonNatAcc 3078 324 1.93 4972.98 839302.15 0 0
## 35 K_Innovprop 2579 823 0.00 4559.34 85674276.60 0 27
## 36 K_EconComp 3078 324 1.16 3647.38 709607.15 0 0
## 37 K_OrgCap 3213 189 0.85 1848.72 2764973.97 0 0
## 38 K_Brand 3213 189 0.23 938.50 3116089.54 0 0
## 39 K_Train 3213 189 0.07 947.22 2346420.72 0 0
## 40 K_Intang 2327 1075 7.35 27620.13 93571593.54 0 0
## 41 K_Intang_rebuilt 2734 668 5.09 10236.61 2235249.75 0 0
## 42 VAConIntang 2838 564 -3.26 0.10 11.77 510 55
## 43 VAConTangICT 2832 570 -3.81 0.05 5.66 735 7
## 44 VAConTangNICT 2833 569 -5.82 0.26 15.10 782 0
## 45 VAConLC 2493 909 -9.96 0.29 9.37 700 12
## 46 VAConTFP 2473 929 -43.39 0.66 26.12 1054 0
## 47 inv_intensity 3370 32 -5.45 19.81 130.73 1 0
## 48 intang_intensity 3146 256 0.80 9.96 35.61 0 0
## 49 tang_intensity 3190 212 -0.71 11.63 106.80 1 0
## 50 intang_share 3140 262 5.46 46.29 93.56 0 0
## 51 sh_compinfo 3141 261 0.00 11.86 75.02 0 157
## 52 sh_innovprop 3146 256 0.12 19.46 79.19 0 0
## 53 sh_econcomp 3144 258 8.66 60.96 99.66 0 0
## 54 sh_nonNA 3100 302 15.32 73.94 100.00 0 0
## 55 sh_rd 3139 263 0.00 3.96 75.88 0 561
## 56 sh_orgcap 3146 256 2.79 24.90 74.36 0 0
## 57 sh_brand 3146 256 2.11 19.21 76.09 0 0
## 58 sh_train 3146 256 0.52 7.46 62.20 0 0
## 59 sh_design 3146 256 0.12 9.37 44.63 0 0
## 60 ict_share 3350 52 0.00 13.79 79.74 0 148
## 61 lp_hour 3213 189 3.06 41.17 9049.13 0 0
## 62 lp_person 3213 189 0.03 61.35 2408.95 0 0
## 63 hours_per_person 3375 27 1.20 1684.45 2731.92 0 0
Columns. n and missing =
observations with and without a value. min,
median, max = the range. negative
and zero = counts of values below and equal to zero. ⚠️ The
point of this table is the minimum and maximum, not the
averages — an impossible value shows up at the extremes. Negative
investment is legitimate in national accounts (disposals exceeding
acquisitions) but makes a share meaningless.
Shares at the very edge of their range, and intensities above 100 percent of value added. Each of these is either real and interesting, or a warning.
extremes <- sections %>%
filter(intang_share >= 99 | intang_share <= 2 |
inv_intensity > 100 | intang_intensity > 100) %>%
select(geo, nace, year, intang_share, intang_intensity, inv_intensity,
I_Intang, I_Tang, I_GFCF, VA_CP) %>%
arrange(desc(intang_share))
nrow(extremes)
## [1] 5
head(as.data.frame(extremes), 15)
## geo nace year intang_share intang_intensity inv_intensity I_Intang I_Tang
## 1 SK J 1998 21.00645 25.27406 122.4582 250.92790 943.6
## 2 SK J 2002 18.96402 19.03645 100.8457 294.09272 1256.7
## 3 SK J 1997 16.62480 21.29525 130.7258 195.56898 980.8
## 4 SK J 1996 15.93710 18.26889 114.0821 139.97093 738.3
## 5 SK J 1995 10.12295 10.65027 103.5176 61.74435 548.2
## I_GFCF VA_CP
## 1 1112.9 908.8
## 2 1430.9 1418.9
## 3 1111.3 850.1
## 4 808.5 708.7
## 5 556.2 537.3
How to read. Every observation at the edge of its range — shares near 0 or 100, intensities above 100 percent of value added — shown with the components that produced them, so you can tell immediately whether the value is real or an artefact of a near-zero denominator.
For an analysis over time, a variable needs a complete run of years for a given industry and country. This counts, for each variable, how many of the 96 section-country pairs have all 27 years.
pairs_total <- length(unique(sections$geo)) * length(focus_sections)
complete_pairs <- sapply(check_vars, function(v) {
sections %>%
group_by(geo, nace) %>%
summarise(n_obs = sum(!is.na(.data[[v]])), .groups = "drop") %>%
summarise(complete = sum(n_obs == 27)) %>%
pull(complete)
})
data.frame(
variable = check_vars,
complete_pairs = complete_pairs,
out_of = pairs_total,
percent_complete = round(100 * complete_pairs / pairs_total, 1)
)
## variable complete_pairs out_of percent_complete
## VA_CP VA_CP 125 126 99.2
## VA_Q VA_Q 125 126 99.2
## VAadj VAadj 120 126 95.2
## VAadj_q VAadj_q 119 126 94.4
## EMP EMP 125 126 99.2
## H_EMP H_EMP 125 126 99.2
## I_GFCF I_GFCF 120 126 95.2
## I_IT I_IT 114 126 90.5
## I_CT I_CT 114 126 90.5
## I_Soft_DB I_Soft_DB 119 126 94.4
## I_RD I_RD 107 126 84.9
## I_OIPP I_OIPP 126 126 100.0
## I_Tang I_Tang 108 126 85.7
## I_Intang I_Intang 104 126 82.5
## I_NatAcc I_NatAcc 107 126 84.9
## I_NonNatAcc I_NonNatAcc 119 126 94.4
## I_Innovprop I_Innovprop 106 126 84.1
## I_EconComp I_EconComp 119 126 94.4
## I_OrgCap I_OrgCap 119 126 94.4
## I_Brand I_Brand 119 126 94.4
## I_Train I_Train 119 126 94.4
## I_Design I_Design 119 126 94.4
## Iq_GFCF Iq_GFCF 120 126 95.2
## Iq_Tang Iq_Tang 108 126 85.7
## Iq_Intang Iq_Intang 104 126 82.5
## Iq_NatAcc Iq_NatAcc 102 126 81.0
## Iq_NonNatAcc Iq_NonNatAcc 119 126 94.4
## K_GFCF K_GFCF 96 126 76.2
## K_RD K_RD 97 126 77.0
## K_Soft_DB K_Soft_DB 101 126 80.2
## K_OIPP K_OIPP 126 126 100.0
## K_Tang K_Tang 90 126 71.4
## K_NatAcc K_NatAcc 91 126 72.2
## K_NonNatAcc K_NonNatAcc 114 126 90.5
## K_Innovprop K_Innovprop 77 126 61.1
## K_EconComp K_EconComp 114 126 90.5
## K_OrgCap K_OrgCap 119 126 94.4
## K_Brand K_Brand 119 126 94.4
## K_Train K_Train 119 126 94.4
## K_Intang K_Intang 77 126 61.1
## K_Intang_rebuilt K_Intang_rebuilt 86 126 68.3
## VAConIntang VAConIntang 6 126 4.8
## VAConTangICT VAConTangICT 0 126 0.0
## VAConTangNICT VAConTangNICT 0 126 0.0
## VAConLC VAConLC 0 126 0.0
## VAConTFP VAConTFP 0 126 0.0
## inv_intensity inv_intensity 120 126 95.2
## intang_intensity intang_intensity 104 126 82.5
## tang_intensity tang_intensity 108 126 85.7
## intang_share intang_share 99 126 78.6
## sh_compinfo sh_compinfo 99 126 78.6
## sh_innovprop sh_innovprop 104 126 82.5
## sh_econcomp sh_econcomp 102 126 81.0
## sh_nonNA sh_nonNA 100 126 79.4
## sh_rd sh_rd 100 126 79.4
## sh_orgcap sh_orgcap 104 126 82.5
## sh_brand sh_brand 104 126 82.5
## sh_train sh_train 104 126 82.5
## sh_design sh_design 104 126 82.5
## ict_share ict_share 112 126 88.9
## lp_hour lp_hour 119 126 94.4
## lp_person lp_person 119 126 94.4
## hours_per_person hours_per_person 125 126 99.2
Columns. complete_pairs = how many of
the 96 country-industry pairs have all 27 years for that variable.
percent_complete is the same as a percentage. ⚠️ This
matters more than overall missingness: a variable can be 95 percent
complete and still have no single unbroken series,
which would rule out any analysis over time.
K_Intang has one year of data for Slovenia, so
01_prepare_data.Rmd rebuilds it as
K_NatAcc + K_NonNatAcc. That rests on two claims which are
tested here.
Claim 1 - the two parts partition the whole. The
variable list defines K_NatAcc as intangibles from national
accounts, K_NonNatAcc as intangibles not included in
national accounts, and K_Intang as total intangibles. Those
partition the same total by construction.
Claim 2 - current-price stocks are additive. Net capital stocks at current replacement cost are all valued in the same year’s prices, so asset categories can be summed.
Eight countries in this dataset have complete K_Intang,
giving over a thousand observations to test on.
stock_identity <- dat %>%
filter(!is.na(K_Intang), !is.na(K_NatAcc), !is.na(K_NonNatAcc), K_Intang > 0) %>%
mutate(rebuilt = K_NatAcc + K_NonNatAcc,
dev_pc = 100 * abs(rebuilt - K_Intang) / K_Intang)
cat("observations tested:", nrow(stock_identity), "\n")
## observations tested: 8529
cat("countries :", paste(sort(unique(stock_identity$geo)), collapse = " "), "\n")
## countries : CZ DE DK ES FI FR IT LT LU LV NL RO SE SI SK UK US
cat("worst deviation :", signif(max(stock_identity$dev_pc), 4), "percent\n")
## worst deviation : 4.322e-14 percent
summary(stock_identity$dev_pc)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.000e+00 0.000e+00 0.000e+00 6.515e-15 1.462e-14 4.322e-14
Columns. rebuilt =
K_NatAcc + K_NonNatAcc. dev_pc = how far that
sum differs from the published K_Intang, as a percentage.
Values around 1e-14 are floating-point rounding — the limit of the
computer’s arithmetic — not real differences. This tests whether the
reconstruction used in 01_prepare_data.Rmd is
legitimate.
# Anywhere the identity does not hold to within 0.01 percent
failures <- stock_identity %>%
filter(dev_pc > 0.01) %>%
select(geo, nace, level, year, K_Intang, rebuilt, dev_pc) %>%
arrange(desc(dev_pc))
if (nrow(failures) == 0) {
cat("The identity holds everywhere it can be tested.\n")
cat("The reconstruction is therefore an arithmetic restatement, not an estimate.\n")
} else {
cat("Identity FAILS in", nrow(failures), "observations - investigate before using.\n")
head(as.data.frame(failures), 15)
}
## The identity holds everywhere it can be tested.
## The reconstruction is therefore an arithmetic restatement, not an estimate.
How to read. Any observation where the identity fails by more than 0.01 percent. If none, the reconstruction is an arithmetic restatement rather than an estimate, and can be described that way in the methodology.
The divisions carry value added and economic competencies only. This confirms which variables are usable at that depth.
div_vars <- c("VA_CP", "VA_Q", "VAadj", "VAadj_q", "H_EMP",
"I_OrgCap", "I_Brand", "I_Train", "I_Design",
"I_EconComp", "I_NonNatAcc",
"K_OrgCap", "K_Brand", "K_Train", "K_EconComp", "K_NonNatAcc",
"I_GFCF", "I_Intang", "I_RD") # last three expected absent for SI
si_div <- divisions %>% filter(geo == "SI")
sapply(div_vars, function(v) {
c(present = sum(!is.na(si_div[[v]])),
missing = sum(is.na(si_div[[v]])))
})
## VA_CP VA_Q VAadj VAadj_q H_EMP I_OrgCap I_Brand I_Train I_Design
## present 648 639 648 648 648 648 648 648 648
## missing 0 9 0 0 0 0 0 0 0
## I_EconComp I_NonNatAcc K_OrgCap K_Brand K_Train K_EconComp K_NonNatAcc
## present 648 648 648 648 648 648 648
## missing 0 0 0 0 0 0 0
## I_GFCF I_Intang I_RD
## present 0 0 0
## missing 648 648 648
How to read. Counts of present and missing observations for Slovenian divisions. Confirms the two-tier structure: value added and the LUISS-estimated intangibles exist below section level; national-accounts investment does not.
Slovenian intangible capital stocks spike in 2020 and fall back in 2021. This section tests whether the stock is consistent with its own investment flow.
A capital stock follows the perpetual inventory method:
K(t) = K(t-1) x (1 - depreciation) + I(t)
Rearranged, the depreciation rate implied by the data is:
implied depreciation = 1 - (K(t) - I(t)) / K(t-1)
That rate should be roughly constant - it is a parameter of the asset, not something that changes year to year. If 2020 produces a wild value, the stock is inconsistent with the flow that supposedly produced it.
Caveat: this is approximate, because both variables are in current prices and a proper perpetual inventory calculation uses constant prices plus a revaluation term. Ordinary revaluation moves the implied rate by a few points. A doubling is far outside that.
pim <- dat %>%
filter(level == "section",
geo %in% c("SI", "CZ", "AT", "DE", "IT", "SK")) %>%
arrange(geo, nace, year) %>%
group_by(geo, nace) %>%
mutate(K_lag = lag(K_OrgCap),
implied_delta = 1 - (K_OrgCap - I_OrgCap) / K_lag) %>%
ungroup() %>%
filter(!is.na(implied_delta), is.finite(implied_delta))
# Section J, recent years - Slovenia against comparators
pim %>%
filter(nace == "J", year >= 2016) %>%
mutate(implied_delta = round(implied_delta, 3)) %>%
select(geo, year, I_OrgCap, K_lag, K_OrgCap, implied_delta) %>%
arrange(geo, year) %>%
as.data.frame()
## geo year I_OrgCap K_lag K_OrgCap implied_delta
## 1 AT 2016 88.15450 243.62996 237.55354 0.387
## 2 AT 2017 91.01579 237.55354 235.84722 0.390
## 3 AT 2018 96.02343 235.84722 240.19939 0.389
## 4 AT 2019 101.64771 240.19939 247.80671 0.392
## 5 AT 2020 106.03713 247.80671 256.38095 0.393
## 6 AT 2021 113.61774 256.38095 269.34301 0.393
## 7 CZ 2016 4772.75693 11368.76274 11616.43845 0.398
## 8 CZ 2017 4898.36225 11616.43845 11890.83121 0.398
## 9 CZ 2018 5026.52957 11890.83121 12235.09090 0.394
## 10 CZ 2019 4755.14399 12235.09090 12333.00449 0.381
## 11 CZ 2020 4613.04488 12333.00449 12188.03436 0.386
## 12 CZ 2021 5938.65334 12188.03436 13440.89063 0.384
## 13 DE 2016 2824.44841 6934.36371 7021.36906 0.395
## 14 DE 2017 2962.89545 7021.36906 7212.83076 0.395
## 15 DE 2018 3148.13073 7212.83076 7526.84134 0.393
## 16 DE 2019 3453.92750 7526.84134 8022.64975 0.393
## 17 DE 2020 3525.35846 8022.64975 8431.33772 0.388
## 18 DE 2021 3809.92640 8431.33772 8987.81324 0.386
## 19 IT 2016 1797.92161 4163.44702 4306.33579 0.398
## 20 IT 2017 1681.35986 4306.33579 4274.81611 0.398
## 21 IT 2018 1591.28569 4274.81611 4166.35234 0.398
## 22 IT 2019 1634.93233 4166.35234 4156.97655 0.395
## 23 IT 2020 1754.02768 4156.97655 4257.98405 0.398
## 24 IT 2021 1891.44077 4257.98405 4466.17134 0.395
## 25 SI 2016 65.23639 76.40862 77.86019 0.835
## 26 SI 2017 67.66167 77.86019 81.60107 0.821
## 27 SI 2018 69.75840 81.60107 87.19803 0.786
## 28 SI 2019 75.79706 87.19803 95.70565 0.772
## 29 SI 2020 76.26180 95.70565 184.58629 -0.132
## 30 SI 2021 47.85337 184.58629 113.88527 0.642
## 31 SK 2016 144.34527 345.03857 346.14419 0.415
## 32 SK 2017 173.53674 346.14419 379.91290 0.404
## 33 SK 2018 164.55734 379.91290 400.46512 0.379
## 34 SK 2019 159.35394 400.46512 400.61561 0.398
## 35 SK 2020 165.28851 400.61561 403.94456 0.404
## 36 SK 2021 201.93342 403.94456 433.91959 0.426
Columns. K_lag = the previous year’s
capital stock. implied_delta = the depreciation rate the
data implies, from 1 − (K(t) − I(t)) / K(t−1). Depreciation
is a property of the asset, so this should be roughly
constant — around 0.39 for organisational capital in
most countries. A wildly different value means the stock is inconsistent
with the investment flow that supposedly produced it. ⚠️ Approximate,
because both variables are in current prices and a proper calculation
adds a revaluation term; ordinary revaluation moves the rate by a few
points, not by a factor of two.
# Is Slovenia's implied rate stable outside 2020?
pim %>%
mutate(period = if_else(year == 2020, "2020", "all other years")) %>%
group_by(geo, period) %>%
summarise(median_delta = round(median(implied_delta), 3),
min_delta = round(min(implied_delta), 3),
max_delta = round(max(implied_delta), 3),
.groups = "drop") %>%
arrange(geo, period) %>%
as.data.frame()
## geo period median_delta min_delta max_delta
## 1 AT 2020 0.393 0.393 0.393
## 2 AT all other years 0.390 0.375 0.393
## 3 CZ 2020 0.386 0.386 0.386
## 4 CZ all other years 0.389 0.322 0.409
## 5 DE 2020 0.388 0.388 0.388
## 6 DE all other years 0.394 0.378 0.403
## 7 IT 2020 0.398 0.398 0.398
## 8 IT all other years 0.390 0.358 0.411
## 9 SI 2020 -0.308 -0.401 -0.132
## 10 SI all other years 0.835 0.495 1.160
## 11 SK 2020 0.404 0.404 0.404
## 12 SK all other years 0.389 0.260 0.446
Columns. Median, minimum and maximum implied depreciation rate, split between 2020 and every other year, by country. A rate above 1.0 is impossible (more than the entire stock depreciating in one year) and a negative rate is impossible too (the stock growing by more than investment can explain).
# Do the FLOWS show anything unusual in 2020, or only the stocks?
dat %>%
filter(level == "section", geo == "SI", year %in% 2018:2021) %>%
select(nace, year, I_OrgCap, K_OrgCap, I_Brand, K_Brand) %>%
arrange(nace, year) %>%
as.data.frame()
## nace year I_OrgCap K_OrgCap I_Brand K_Brand
## 1 C 2018 283.59090 354.95619 231.97079 406.70260
## 2 C 2019 295.94952 378.83631 251.00998 436.18354
## 3 C 2020 294.84021 725.31713 231.36555 428.98206
## 4 C 2021 174.10852 425.53261 285.37741 476.18546
## 5 G 2018 167.10410 174.11751 209.97546 365.49959
## 6 G 2019 176.66690 184.55943 231.53011 397.94375
## 7 G 2020 189.94972 448.57858 299.60007 479.89173
## 8 G 2021 84.75761 207.26723 379.76971 593.22200
## 9 H 2018 52.45787 55.29654 14.61963 25.31638
## 10 H 2019 55.36132 60.43920 16.10356 27.63023
## 11 H 2020 50.65875 129.93497 11.74672 24.26482
## 12 H 2021 27.21122 67.59209 13.64667 24.43949
## 13 I 2018 20.47424 19.45418 16.05376 27.76031
## 14 I 2019 22.01447 22.24692 17.89926 30.53866
## 15 I 2020 23.66146 54.23733 17.02509 30.86088
## 16 I 2021 10.01685 24.51997 21.51486 35.24155
## 17 J 2018 69.75840 87.19803 62.98958 108.45388
## 18 J 2019 75.79706 95.70565 69.29380 118.67335
## 19 J 2020 76.26180 184.58629 75.50910 129.27503
## 20 J 2021 47.85337 113.88527 88.05446 145.55504
## 21 M 2018 147.80300 152.81472 126.09922 215.13213
## 22 M 2019 157.24491 170.17338 141.65053 239.60118
## 23 M 2020 150.79050 372.68417 143.72077 252.27403
## 24 M 2021 84.16066 200.54390 176.98983 289.19945
How to read. Investment flows and capital stocks side by side for Slovenia. The question is whether 2020 looks unusual in the flows as well, or only in the stocks — which determines whether the fault is in the underlying investment data or in how the stock series was constructed.
# Judged on Slovenia, at section level, out of 27 years per section.
worst_si <- apply(missing_si, 1, max) # worst section for each variable
verdict <- data.frame(
variable = names(worst_si),
max_missing = as.integer(worst_si),
assessment = ifelse(worst_si == 0, "complete - safe to use",
ifelse(worst_si <= 6, "near-complete - state the period",
ifelse(worst_si <= 14, "partial - state the period clearly",
"sparse - do not use without care")))
)
verdict[order(verdict$max_missing, verdict$variable), ]
## variable max_missing
## EMP EMP 0
## H_EMP H_EMP 0
## hours_per_person hours_per_person 0
## I_Brand I_Brand 0
## I_CT I_CT 0
## I_Design I_Design 0
## I_EconComp I_EconComp 0
## I_GFCF I_GFCF 0
## I_IT I_IT 0
## I_NonNatAcc I_NonNatAcc 0
## I_OIPP I_OIPP 0
## I_OrgCap I_OrgCap 0
## I_Soft_DB I_Soft_DB 0
## I_Tang I_Tang 0
## I_Train I_Train 0
## ict_share ict_share 0
## inv_intensity inv_intensity 0
## Iq_GFCF Iq_GFCF 0
## Iq_NonNatAcc Iq_NonNatAcc 0
## Iq_Tang Iq_Tang 0
## K_Brand K_Brand 0
## K_EconComp K_EconComp 0
## K_NonNatAcc K_NonNatAcc 0
## K_OIPP K_OIPP 0
## K_OrgCap K_OrgCap 0
## K_Train K_Train 0
## lp_hour lp_hour 0
## lp_person lp_person 0
## tang_intensity tang_intensity 0
## VA_CP VA_CP 0
## VA_Q VA_Q 0
## VAadj VAadj 0
## VAadj_q VAadj_q 0
## K_GFCF K_GFCF 5
## K_Soft_DB K_Soft_DB 5
## K_Tang K_Tang 5
## K_Innovprop K_Innovprop 11
## K_Intang_rebuilt K_Intang_rebuilt 11
## K_NatAcc K_NatAcc 11
## K_RD K_RD 11
## VAConIntang VAConIntang 11
## VAConTangICT VAConTangICT 11
## VAConTangNICT VAConTangNICT 11
## I_Innovprop I_Innovprop 14
## I_Intang I_Intang 14
## I_NatAcc I_NatAcc 14
## I_RD I_RD 14
## intang_intensity intang_intensity 14
## intang_share intang_share 14
## sh_brand sh_brand 14
## sh_compinfo sh_compinfo 14
## sh_design sh_design 14
## sh_econcomp sh_econcomp 14
## sh_innovprop sh_innovprop 14
## sh_nonNA sh_nonNA 14
## sh_orgcap sh_orgcap 14
## sh_rd sh_rd 14
## sh_train sh_train 14
## VAConLC VAConLC 14
## VAConTFP VAConTFP 14
## Iq_Intang Iq_Intang 21
## Iq_NatAcc Iq_NatAcc 21
## K_Intang K_Intang 26
## assessment
## EMP complete - safe to use
## H_EMP complete - safe to use
## hours_per_person complete - safe to use
## I_Brand complete - safe to use
## I_CT complete - safe to use
## I_Design complete - safe to use
## I_EconComp complete - safe to use
## I_GFCF complete - safe to use
## I_IT complete - safe to use
## I_NonNatAcc complete - safe to use
## I_OIPP complete - safe to use
## I_OrgCap complete - safe to use
## I_Soft_DB complete - safe to use
## I_Tang complete - safe to use
## I_Train complete - safe to use
## ict_share complete - safe to use
## inv_intensity complete - safe to use
## Iq_GFCF complete - safe to use
## Iq_NonNatAcc complete - safe to use
## Iq_Tang complete - safe to use
## K_Brand complete - safe to use
## K_EconComp complete - safe to use
## K_NonNatAcc complete - safe to use
## K_OIPP complete - safe to use
## K_OrgCap complete - safe to use
## K_Train complete - safe to use
## lp_hour complete - safe to use
## lp_person complete - safe to use
## tang_intensity complete - safe to use
## VA_CP complete - safe to use
## VA_Q complete - safe to use
## VAadj complete - safe to use
## VAadj_q complete - safe to use
## K_GFCF near-complete - state the period
## K_Soft_DB near-complete - state the period
## K_Tang near-complete - state the period
## K_Innovprop partial - state the period clearly
## K_Intang_rebuilt partial - state the period clearly
## K_NatAcc partial - state the period clearly
## K_RD partial - state the period clearly
## VAConIntang partial - state the period clearly
## VAConTangICT partial - state the period clearly
## VAConTangNICT partial - state the period clearly
## I_Innovprop partial - state the period clearly
## I_Intang partial - state the period clearly
## I_NatAcc partial - state the period clearly
## I_RD partial - state the period clearly
## intang_intensity partial - state the period clearly
## intang_share partial - state the period clearly
## sh_brand partial - state the period clearly
## sh_compinfo partial - state the period clearly
## sh_design partial - state the period clearly
## sh_econcomp partial - state the period clearly
## sh_innovprop partial - state the period clearly
## sh_nonNA partial - state the period clearly
## sh_orgcap partial - state the period clearly
## sh_rd partial - state the period clearly
## sh_train partial - state the period clearly
## VAConLC partial - state the period clearly
## VAConTFP partial - state the period clearly
## Iq_Intang sparse - do not use without care
## Iq_NatAcc sparse - do not use without care
## K_Intang sparse - do not use without care
Columns. max_missing = the worst
section for that variable, out of 27 years. assessment
classifies it. ⚠️ Judged by the worst section, not the
average — a chapter claiming “1995–2021” while one industry starts in
2008 would be misleading.
Investment flows are usable. I_GFCF,
I_Tang, I_Intang and the individual asset
flows are complete for Slovenia across all six sections, apart from
section H and two single years. The derived indicators built on them -
intensities, shares, composition - inherit that reliability.
Slovenian capital stocks are not usable. The
perpetual inventory check shows the Slovenian K_OrgCap
series is inconsistent with its own investment flow in every
year, not only in 2020. The implied depreciation rate is 0.835 for
Slovenia against roughly 0.39 for Austria, Czechia, Germany, Italy and
Slovakia, and its range reaches 1.160 - a rate above 1.0 being
impossible. In 2020 the implied rate is negative, which is also
impossible.
This propagates through K_OrgCap to
K_EconComp, K_NonNatAcc and therefore
K_Intang_rebuilt. Excluding 2020 alone is
not sufficient.
Growth accounting is usable over shorter periods - capital contributions from 2001, TFP and labour quality only from 2009.
The analysis is therefore built on flows, with stocks used only where a comparator country supplies them and Slovenia is not the subject.
K_Brand and K_Train show the same
inconsistency, or whether the problem is confined to organisational
capital.I_OrgCap falls by roughly 45 percent in 2021 in every
Slovenian section while I_Brand rises. A second anomaly, in
the flows this time, not yet explained.