Data Analysis

In this study we investigate the timing of goodwill impairment and corporate bond issuance. If the empirical evidence show that structurally more impairments are announced after debt financing, it would provide evidence for strategic timing of impairment in order to secure debt financing.

To test this, we will use data from WRDS Audit Analytics and Mergent FISD Bond data.

Impairment data

In this part, we will import the impairment data from Audit Analytics which includes all material write downs that a firms file to SEC in 10-K, 10-Q, 8-K.

####Import impairment data

library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.1.3
## Warning: package 'tibble' was built under R version 4.1.3
## Warning: package 'tidyr' was built under R version 4.1.3
## Warning: package 'readr' was built under R version 4.1.3
## Warning: package 'purrr' was built under R version 4.1.3
## Warning: package 'dplyr' was built under R version 4.1.3
## Warning: package 'forcats' was built under R version 4.1.3
## Warning: package 'lubridate' was built under R version 4.1.3
## -- Attaching core tidyverse packages ------------------------ tidyverse 2.0.0 --
## v dplyr     1.1.2     v readr     2.1.4
## v forcats   1.0.0     v stringr   1.5.1
## v ggplot2   3.4.4     v tibble    3.2.1
## v lubridate 1.9.2     v tidyr     1.3.0
## v purrr     1.0.1     
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
## i Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
 setwd("C:/MyFolder")  
 load(file = "aa_impairment_data.rda") 
impairment_data<-select(aa.impairment.data,c(
  "COMPANY_FKEY",
  "QUANTITATIVE_TAXONOMY_TEXT",
  "QUALTTIVE_TXNMY_TXT",
  "DT_OF_8K_NTIFICATION",
  "FILE_DATE",
  "DATE_OF_8K_FORM_FKEY",
  "FORM_FKEY",
  "MTRL_IMPRMNT_FCT_KEY",
  "ESTMATD_IMPCT_PRTX_INCM",
  "ESTMATD_IMPCT_NT_INCM",
  "MATCHQU_TSO_MARKCAP",
  "MATCHQU_BALSH_ASSETS",
  "MATCHQU_BALSH_BOOK_VAL",
  "MATCHQU_INCMST_EBITDA_QTR",
  "MATCHQU_INCMST_EBITDA_TTM",
  "MATCHQU_INCMST_NETINC_QTR",
  "MATCHQU_INCMST_NETINC_TTM",
  "MATERIAL_IMPAIRMENT_TEXT"
  )
)
  head(impairment_data,10) 
## # A tibble: 10 x 18
##    COMPANY_FKEY QUANTITATIVE_TAXONOMY~1 QUALTTIVE_TXNMY_TXT DT_OF_8K_NTIFICATION
##    <chr>        <chr>                   <chr>               <chr>               
##  1 0000001750   PPE - Property, plant,~ ""                  ""                  
##  2 0000001750   PPE - Property, plant,~ ""                  ""                  
##  3 0000001750   PPE - Property, plant,~ "|Discontinued Ope~ ""                  
##  4 0000001750   PPE - Property, plant,~ ""                  ""                  
##  5 0000001750   Inventory               ""                  ""                  
##  6 0000001750   PPE - Property, plant,~ "|Discontinued Ope~ ""                  
##  7 0000001750   Inventory               "|Discontinued Ope~ ""                  
##  8 0000001750   Other/unspecified/misc~ "|Discontinued Ope~ ""                  
##  9 0000001750   Intangible Assets - Go~ "|Discontinued Ope~ ""                  
## 10 0000001750   Other/unspecified/misc~ "|Discontinued Ope~ ""                  
## # i abbreviated name: 1: QUANTITATIVE_TAXONOMY_TEXT
## # i 14 more variables: FILE_DATE <date>, DATE_OF_8K_FORM_FKEY <chr>,
## #   FORM_FKEY <chr>, MTRL_IMPRMNT_FCT_KEY <dbl>, ESTMATD_IMPCT_PRTX_INCM <dbl>,
## #   ESTMATD_IMPCT_NT_INCM <dbl>, MATCHQU_TSO_MARKCAP <dbl>,
## #   MATCHQU_BALSH_ASSETS <dbl>, MATCHQU_BALSH_BOOK_VAL <dbl>,
## #   MATCHQU_INCMST_EBITDA_QTR <dbl>, MATCHQU_INCMST_EBITDA_TTM <dbl>,
## #   MATCHQU_INCMST_NETINC_QTR <dbl>, MATCHQU_INCMST_NETINC_TTM <dbl>, ...

Create new variables

impairment_data<-impairment_data |> 
  mutate(
    impairment_amount = -1* ESTMATD_IMPCT_PRTX_INCM,
    .after = FILE_DATE
  ) |> 
  mutate(impairment_over_assets =  impairment_amount/MATCHQU_BALSH_ASSETS,
         .after = impairment_amount)
         
head(impairment_data,10) 
## # A tibble: 10 x 20
##    COMPANY_FKEY QUANTITATIVE_TAXONOMY~1 QUALTTIVE_TXNMY_TXT DT_OF_8K_NTIFICATION
##    <chr>        <chr>                   <chr>               <chr>               
##  1 0000001750   PPE - Property, plant,~ ""                  ""                  
##  2 0000001750   PPE - Property, plant,~ ""                  ""                  
##  3 0000001750   PPE - Property, plant,~ "|Discontinued Ope~ ""                  
##  4 0000001750   PPE - Property, plant,~ ""                  ""                  
##  5 0000001750   Inventory               ""                  ""                  
##  6 0000001750   PPE - Property, plant,~ "|Discontinued Ope~ ""                  
##  7 0000001750   Inventory               "|Discontinued Ope~ ""                  
##  8 0000001750   Other/unspecified/misc~ "|Discontinued Ope~ ""                  
##  9 0000001750   Intangible Assets - Go~ "|Discontinued Ope~ ""                  
## 10 0000001750   Other/unspecified/misc~ "|Discontinued Ope~ ""                  
## # i abbreviated name: 1: QUANTITATIVE_TAXONOMY_TEXT
## # i 16 more variables: FILE_DATE <date>, impairment_amount <dbl>,
## #   impairment_over_assets <dbl>, DATE_OF_8K_FORM_FKEY <chr>, FORM_FKEY <chr>,
## #   MTRL_IMPRMNT_FCT_KEY <dbl>, ESTMATD_IMPCT_PRTX_INCM <dbl>,
## #   ESTMATD_IMPCT_NT_INCM <dbl>, MATCHQU_TSO_MARKCAP <dbl>,
## #   MATCHQU_BALSH_ASSETS <dbl>, MATCHQU_BALSH_BOOK_VAL <dbl>,
## #   MATCHQU_INCMST_EBITDA_QTR <dbl>, MATCHQU_INCMST_EBITDA_TTM <dbl>, ...

####create dummy variable

impairment_data$goodwill_impairment <- as.integer(grepl("Goodwill", impairment_data$QUANTITATIVE_TAXONOMY_TEXT, fixed = TRUE))

impairment_data$F8K<-as.integer(grepl("8-K",impairment_data$DATE_OF_8K_FORM_FKEY,fixed=TRUE))

glimpse(impairment_data) 
## Rows: 29,495
## Columns: 22
## $ COMPANY_FKEY               <chr> "0000001750", "0000001750", "0000001750", "~
## $ QUANTITATIVE_TAXONOMY_TEXT <chr> "PPE - Property, plant, equipment", "PPE - ~
## $ QUALTTIVE_TXNMY_TXT        <chr> "", "", "|Discontinued Operations|", "", ""~
## $ DT_OF_8K_NTIFICATION       <chr> "", "", "", "", "", "", "", "", "", "", "",~
## $ FILE_DATE                  <date> 2011-07-13, 2012-07-19, 2015-07-15, 2015-0~
## $ impairment_amount          <dbl> 5355000, 2500000, 57500000, 17700000, 89000~
## $ impairment_over_assets     <dbl> 0.0030558580, 0.0011519145, 0.0371639090, 0~
## $ DATE_OF_8K_FORM_FKEY       <chr> "", "", "", "", "", "", "", "", "", "", "",~
## $ FORM_FKEY                  <chr> "10-K", "10-K", "10-K", "10-K", "10-K", "10~
## $ MTRL_IMPRMNT_FCT_KEY       <dbl> 16441, 14728, 13398, 20029, 20030, 25278, 2~
## $ ESTMATD_IMPCT_PRTX_INCM    <dbl> -5355000, -2500000, -57500000, -17700000, -~
## $ ESTMATD_IMPCT_NT_INCM      <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,~
## $ MATCHQU_TSO_MARKCAP        <dbl> 874988096, 597283264, 841740672, 841740672,~
## $ MATCHQU_BALSH_ASSETS       <dbl> 1752372000, 2170300000, 1547200000, 1547200~
## $ MATCHQU_BALSH_BOOK_VAL     <dbl> 670540000, 462100000, 697200000, 697200000,~
## $ MATCHQU_INCMST_EBITDA_QTR  <dbl> 55100000, 69000000, 33800000, 33800000, 338~
## $ MATCHQU_INCMST_EBITDA_TTM  <dbl> 2.1460e+08, 2.4910e+08, 3.4800e+07, 3.4800e~
## $ MATCHQU_INCMST_NETINC_QTR  <dbl> 16600000, 18200000, 22900000, 22900000, 229~
## $ MATCHQU_INCMST_NETINC_TTM  <dbl> 72700000, 69300000, 18700000, 18700000, 187~
## $ MATERIAL_IMPAIRMENT_TEXT   <chr> "12. Impairment Charges  Aircraft          ~
## $ goodwill_impairment        <int> 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0~
## $ F8K                        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1~

####summary statistics

summary_statistics_df<-impairment_data |> 
 
  summarise(
    mean_impairment_amount = mean(impairment_amount, na.rm = TRUE),
    sd_impairment_amount = sd(impairment_amount, na.rm = TRUE),
    min_impairment_amount = min(impairment_amount, na.rm = TRUE),
    max_impairment_amount = max(impairment_amount, na.rm = TRUE),
    mean_impairment_over_assets = mean(impairment_over_assets, na.rm = TRUE),
    sd_impairment_over_assets = sd(impairment_over_assets, na.rm = TRUE),
    min_impairment_over_assets = min(impairment_over_assets, na.rm = TRUE),
    max_impairment_over_assets = max(impairment_over_assets, na.rm = TRUE),
    mean_goodwill_impairment = mean(goodwill_impairment, na.rm = TRUE),
    sd_goodwill_impairment = sd(goodwill_impairment, na.rm = TRUE),
    min_goodwill_impairment = min(goodwill_impairment, na.rm = TRUE),
    max_goodwill_impairment = max(goodwill_impairment, na.rm = TRUE),
    mean_F8K=mean(F8K, na.rm = TRUE)

  ) 
  head(summary_statistics_df)
## # A tibble: 1 x 13
##   mean_impairment_amount sd_impairment_amount min_impairment_amount
##                    <dbl>                <dbl>                 <dbl>
## 1             453803941.         28821618861.            -214000000
## # i 10 more variables: max_impairment_amount <dbl>,
## #   mean_impairment_over_assets <dbl>, sd_impairment_over_assets <dbl>,
## #   min_impairment_over_assets <dbl>, max_impairment_over_assets <dbl>,
## #   mean_goodwill_impairment <dbl>, sd_goodwill_impairment <dbl>,
## #   min_goodwill_impairment <int>, max_goodwill_impairment <int>,
## #   mean_F8K <dbl>
library(tidyverse)
##plot impairment_amount based on the categories in the QUANTITATIVE_TAXONOMY_TEXT
ggplot(impairment_data, aes(x = FILE_DATE, y = impairment_amount, color = QUANTITATIVE_TAXONOMY_TEXT, group = QUANTITATIVE_TAXONOMY_TEXT)) +
  geom_line()

library(tidyverse)

# Summarize data to count occurrences of each QUANTITATIVE_TAXONOMY_TEXT
summary_data <- impairment_data %>%
  group_by(QUANTITATIVE_TAXONOMY_TEXT) %>%
  summarise(count = n()) %>%
  mutate(prop = count / sum(count)) # Calculate proportions

# Plot pie chart
ggplot(summary_data, aes(x = "", y = prop, fill = QUANTITATIVE_TAXONOMY_TEXT)) +
  geom_bar(width = 1, stat = "identity", color = "white") +
  coord_polar("y", start = 0) +
  theme_void() +
  labs(fill = "Quantitative Taxonomy", 
       title = "Pie Chart of Occurrences by Quantitative Taxonomy")

library(dplyr)
library(tidyverse)

# Step 1: Count occurrences of each group
count_data <- impairment_data %>%
  group_by(QUANTITATIVE_TAXONOMY_TEXT) %>%
  summarise(count = n())

# Step 2 & 3: Filter for "Intangible Assets - Goodwill" and calculate its percentage
goodwill_data <- impairment_data %>%
  filter(QUANTITATIVE_TAXONOMY_TEXT == "Intangible Assets - Goodwill") %>%
  summarise(
    goodwill_count = n(),
    total_count = nrow(impairment_data),
    percentage = (goodwill_count / total_count) * 100
  )

# Printing the result
print(goodwill_data)
## # A tibble: 1 x 3
##   goodwill_count total_count percentage
##            <int>       <int>      <dbl>
## 1           4894       29495       16.6
# Filter for "8-K" and count occurrences
eight_k_count <- impairment_data %>%
  filter(DATE_OF_8K_FORM_FKEY == "8-K") %>%
  summarise(Count = n())

# Print the count of "8-K"
print(eight_k_count)
## # A tibble: 1 x 1
##   Count
##   <int>
## 1  1147
# filter data with 8-K filing and goodwill impairment 
filtered_data <- impairment_data %>%
  filter(QUANTITATIVE_TAXONOMY_TEXT == "Intangible Assets - Goodwill" & DATE_OF_8K_FORM_FKEY == "8-K")

# View the filtered data, in total 241 observations
head(filtered_data,10)
## # A tibble: 10 x 22
##    COMPANY_FKEY QUANTITATIVE_TAXONOMY~1 QUALTTIVE_TXNMY_TXT DT_OF_8K_NTIFICATION
##    <chr>        <chr>                   <chr>               <chr>               
##  1 0000005133   Intangible Assets - Go~ |Item 2.06 8-K Dis~ 2005-12-12          
##  2 0000006951   Intangible Assets - Go~ |Item 2.06 8-K Dis~ 2012-05-10          
##  3 0000006955   Intangible Assets - Go~ |Item 2.06 8-K Dis~ 2012-09-18          
##  4 0000006955   Intangible Assets - Go~ |Discontinued Oper~ 2013-06-03          
##  5 0000006955   Intangible Assets - Go~ |Assets held for s~ 2019-01-24          
##  6 0000008868   Intangible Assets - Go~ |Discontinued Oper~ 2013-07-02          
##  7 0000008868   Intangible Assets - Go~ |Item 2.06 8-K Dis~ 2022-11-10          
##  8 0000009984   Intangible Assets - Go~ |Item 2.06 8-K Dis~ 2022-07-29          
##  9 0000012659   Intangible Assets - Go~ |Item 2.06 8-K Dis~ 2011-08-24          
## 10 0000016040   Intangible Assets - Go~ |Item 2.06 8-K Dis~ 2015-07-16          
## # i abbreviated name: 1: QUANTITATIVE_TAXONOMY_TEXT
## # i 18 more variables: FILE_DATE <date>, impairment_amount <dbl>,
## #   impairment_over_assets <dbl>, DATE_OF_8K_FORM_FKEY <chr>, FORM_FKEY <chr>,
## #   MTRL_IMPRMNT_FCT_KEY <dbl>, ESTMATD_IMPCT_PRTX_INCM <dbl>,
## #   ESTMATD_IMPCT_NT_INCM <dbl>, MATCHQU_TSO_MARKCAP <dbl>,
## #   MATCHQU_BALSH_ASSETS <dbl>, MATCHQU_BALSH_BOOK_VAL <dbl>,
## #   MATCHQU_INCMST_EBITDA_QTR <dbl>, MATCHQU_INCMST_EBITDA_TTM <dbl>, ...
library(tidyverse)
filtered_data |> 
  summarize(mean(impairment_amount,na.rm=TRUE))
## # A tibble: 1 x 1
##   `mean(impairment_amount, na.rm = TRUE)`
##                                     <dbl>
## 1                              507094639.

The average impairment is $507 million in this filtered sample.

testing of the CIK and CUSIP codes

#find the entries with Company_FKEY equals to 0000005133 

aa.impairment.data |> 
  filter(COMPANY_FKEY=="0000005133"
)
## # A tibble: 8 x 221
##   MTRL_IMPRMNT_FCT_KEY QUANTITATIVE_TAXONOMY_FKEY MTRL_IMPRMNT_KEY
##                  <dbl>                      <dbl>            <dbl>
## 1                 2634                          1             2334
## 2                14865                          1             8463
## 3                10434                          1             5172
## 4                11085                          3             5640
## 5                11086                          2             5640
## 6                11087                         24             5640
## 7                19632                          3            11843
## 8                19633                          2            11843
## # i 218 more variables: QUANTITATIVE_TAXONOMY_TEXT <chr>,
## #   ESTMATD_IMPCT_NT_INCM <dbl>, ESTMATD_IMPCT_PRTX_INCM <dbl>,
## #   IMPCT_ON_EARNING_PR_SHR <dbl>, IMPCT_ON_EARNING_PR_SHR_DILUTD <dbl>,
## #   CURRNCY_CDE_FKEY <chr>, ESTMATD_IMPCT_NT_INCME_USD <dbl>,
## #   ESTMATD_IMPCT_PRTAX_INCM_USD <dbl>, CONSOLIDATED_AMOUNT_USD <dbl>,
## #   CONSOLIDATED_AMOUNT_FLAG <chr>, CONSOLIDATED_AMOUNT_LABEL <chr>,
## #   IMPCT_ON_EARNING_PR_SHR_USD <dbl>, IMPCT_ON_ERNG_PR_SHR_DLTD_USD <dbl>, ...
aa.impairment.data |> 
  filter(COMPANY_FKEY=="0000722077"
)
## # A tibble: 4 x 221
##   MTRL_IMPRMNT_FCT_KEY QUANTITATIVE_TAXONOMY_FKEY MTRL_IMPRMNT_KEY
##                  <dbl>                      <dbl>            <dbl>
## 1                14813                         24             8422
## 2                20471                          6             8422
## 3                 8683                          3             4386
## 4                18635                         24            11140
## # i 218 more variables: QUANTITATIVE_TAXONOMY_TEXT <chr>,
## #   ESTMATD_IMPCT_NT_INCM <dbl>, ESTMATD_IMPCT_PRTX_INCM <dbl>,
## #   IMPCT_ON_EARNING_PR_SHR <dbl>, IMPCT_ON_EARNING_PR_SHR_DILUTD <dbl>,
## #   CURRNCY_CDE_FKEY <chr>, ESTMATD_IMPCT_NT_INCME_USD <dbl>,
## #   ESTMATD_IMPCT_PRTAX_INCM_USD <dbl>, CONSOLIDATED_AMOUNT_USD <dbl>,
## #   CONSOLIDATED_AMOUNT_FLAG <chr>, CONSOLIDATED_AMOUNT_LABEL <chr>,
## #   IMPCT_ON_EARNING_PR_SHR_USD <dbl>, IMPCT_ON_ERNG_PR_SHR_DLTD_USD <dbl>, ...

The company FKEY in the Audit Analytics data are 10 digits. The CIK code typically contain the same numbers in the last 4-7 digits as the company FKEY. We are able to find companies based on their CIK code in the impairment data from Audit Analytics data. We only need to add 3-6 zeros in front of the CIK code in order to make it a 10-digit number. The previous two examples show that.

# 1674862  ASHLAND GLOBAL HOLDINGS INC
aa.impairment.data |> 
  filter(COMPANY_FKEY=="0001674862"
)
## # A tibble: 4 x 221
##   MTRL_IMPRMNT_FCT_KEY QUANTITATIVE_TAXONOMY_FKEY MTRL_IMPRMNT_KEY
##                  <dbl>                      <dbl>            <dbl>
## 1                25608                          3            15506
## 2                28564                          1            17751
## 3                33651                          3            21278
## 4                33652                         24            21278
## # i 218 more variables: QUANTITATIVE_TAXONOMY_TEXT <chr>,
## #   ESTMATD_IMPCT_NT_INCM <dbl>, ESTMATD_IMPCT_PRTX_INCM <dbl>,
## #   IMPCT_ON_EARNING_PR_SHR <dbl>, IMPCT_ON_EARNING_PR_SHR_DILUTD <dbl>,
## #   CURRNCY_CDE_FKEY <chr>, ESTMATD_IMPCT_NT_INCME_USD <dbl>,
## #   ESTMATD_IMPCT_PRTAX_INCM_USD <dbl>, CONSOLIDATED_AMOUNT_USD <dbl>,
## #   CONSOLIDATED_AMOUNT_FLAG <chr>, CONSOLIDATED_AMOUNT_LABEL <chr>,
## #   IMPCT_ON_EARNING_PR_SHR_USD <dbl>, IMPCT_ON_ERNG_PR_SHR_DLTD_USD <dbl>, ...

Corporate bond data

The corporate bond data comes from Mergent FISD Issue data. This dataset includes the characteristics of bond issues, for example, Isser ID, Issue date, Principal amount, Maturity, Guarantee or not etc.

####Import data and some basic test of the ISSUER_CUSIP

library(tidyverse)
setwd("C:/MyFolder")  
bond_data<- readRDS(file = "fisd_issue.rds") 

Bdata<-select(bond_data,c(
  "ISSUE_ID",
  "ISSUER_ID",
  "PROSPECTUS_ISSUER_NAME",
  "ISSUER_CUSIP",
  "ISSUE_CUSIP",
  "ISSUE_NAME",
  "MATURITY",
  "SECURITY_LEVEL",
  "GROSS_SPREAD",
  "OFFERING_DATE",
  "OFFERING_AMT",
  "OFFERING_PRICE",
  "OFFERING_YIELD",
  "DELIVERY_DATE",
  "COVENANTS"
  )
)
  head(Bdata,10)
## # A tibble: 10 x 15
##    ISSUE_ID ISSUER_ID PROSPECTUS_ISSUER_NAME ISSUER_CUSIP ISSUE_CUSIP ISSUE_NAME
##       <dbl>     <dbl> <chr>                  <chr>        <chr>       <chr>     
##  1        1         3 AAR CORP               000361       AA3         NT        
##  2        2         3 AAR CORP               000361       AB1         NT        
##  3        3     40263 ABN AMRO BK N V N Y B~ 00077D       AB5         MTN       
##  4        4     40263 ABN AMRO BK N V N Y B~ 00077D       AF6         SUB DEP N~
##  5        5     40263 ABN AMRO BK N V N Y B~ 00077T       AA2         SUB DEP N~
##  6        6     40263 ABN AMRO BK N V N Y B~ 00077T       AB0         SUB DEP N~
##  7        8         6 ACF INDS INC           000800       AR3         EQUIP TR ~
##  8        9         6 ACF INDS INC           000800       AX0         EQUIP TR ~
##  9       10         6 ACF INDS INC           000800       AY8         EQUIP TR ~
## 10       11         6 ACF INDS INC           000800       BA9         SINKING F~
## # i 9 more variables: MATURITY <date>, SECURITY_LEVEL <chr>,
## #   GROSS_SPREAD <dbl>, OFFERING_DATE <date>, OFFERING_AMT <dbl>,
## #   OFFERING_PRICE <dbl>, OFFERING_YIELD <dbl>, DELIVERY_DATE <date>,
## #   COVENANTS <chr>
  #in total 602,446 observations 
bond_data |> 
  filter(ISSUER_CUSIP=="026375")
## # A tibble: 14 x 66
##    ISSUE_ID ISSUER_ID PROSPECTUS_ISSUER_NAME ISSUER_CUSIP ISSUE_CUSIP ISSUE_NAME
##       <dbl>     <dbl> <chr>                  <chr>        <chr>       <chr>     
##  1      877       181 AMERICAN GREETINGS CO~ 026375       AC9         NT        
##  2      878       181 AMERICAN GREETINGS CO~ 026375       AD7         NT        
##  3    78371       181 AMERICAN GREETINGS CO~ 026375       AE5         NT        
##  4   124616       181 AMERICAN GREETINGS CO~ 026375       AF2         SR SUB NT~
##  5   124714       181 AMERICAN GREETINGS CO~ 026375       AH8         SR SUB NT~
##  6   132569       181 AMERICAN GREETINGS CO~ 026375       AJ4         SUB NT CO~
##  7   135384       181 AMERICAN GREETINGS CO~ 026375       AG0         SR SUB NT 
##  8   340085       181 AMERICAN GREETINGS CO~ 026375       AL9         SR NT     
##  9   343332       181 AMERICAN GREETINGS CO~ 026375       AK1         SUB NT CO~
## 10   496746       181 AMERICAN GREETINGS CO~ 026375       AN5         SR NT     
## 11   496761       181 AMERICAN GREETINGS CO~ 026375       AM7         SR NT     
## 12   565251       181 AMERICAN GREETINGS CO~ 026375       AP0         SR NT     
## 13   751113       181 AMERICAN GREETINGS CO~ 026375       AR6         SR NT RUL~
## 14   807937       181 AMERICAN GREETINGS CO~ 026375       AQ8         SR NT RUL~
## # i 60 more variables: MATURITY <date>, SECURITY_LEVEL <chr>,
## #   SECURITY_PLEDGE <chr>, ENHANCEMENT <chr>, COUPON_TYPE <chr>,
## #   CONVERTIBLE <chr>, MTN <chr>, ASSET_BACKED <chr>, YANKEE <chr>,
## #   CANADIAN <chr>, OID <chr>, FOREIGN_CURRENCY <chr>, SLOB <chr>,
## #   ISSUE_OFFERED_GLOBAL <chr>, SETTLEMENT_TYPE <chr>, GROSS_SPREAD <dbl>,
## #   SELLING_CONCESSION <dbl>, REALLOWANCE <dbl>, COMP_NEG_EXCH_DEAL <chr>,
## #   RULE_415_REG <chr>, SEC_REG_TYPE1 <chr>, SEC_REG_TYPE2 <chr>, ...
 # CUSI== 92113B106 ISSUER NAME==VAN KAMPEN STRATEGIC GROWTH FD There is a mismatch of the issuer name. 

bond_data |> 
  filter(ISSUER_CUSIP=="092113")
## # A tibble: 19 x 66
##    ISSUE_ID ISSUER_ID PROSPECTUS_ISSUER_NAME ISSUER_CUSIP ISSUE_CUSIP ISSUE_NAME
##       <dbl>     <dbl> <chr>                  <chr>        <chr>       <chr>     
##  1     2544       526 BLACK HILLS CORP       092113       AA7         1ST MTG S~
##  2     2545       526 BLACK HILLS CORP       092113       AB5         1ST MTG S~
##  3    27151       526 BLACK HILLS CORP       092113       AC3         1ST MTG S~
##  4   113292       526 BLACK HILLS CORP       092113       @A0         1ST MTG B~
##  5   164331       526 BLACK HILLS CORP       092113       AE9         NT        
##  6   495892       526 BLACK HILLS CORP       092113       AF6         NT        
##  7   526935       526 BLACK HILLS CORP       092113       AG4         SR NT     
##  8   645881       526 BLACK HILLS CORP       092113       AK5         SR NT     
##  9   645883       526 BLACK HILLS CORP       092113       AL3         SR NT     
## 10   647482       526 BLACK HILLS CORP       092113       AH2         NT        
## 11   660081       526 BLACK HILLS CORP       092113       AM1         GLOBAL SR~
## 12   660083       526 BLACK HILLS CORP       092113       AN9         GLOBAL SR~
## 13   673041       526 BLACK HILLS CORP       092113       125         EQUITY UN~
## 14   775905       526 BLACK HILLS CORP       092113       AQ2         GLOBAL SR~
## 15   853155       526 BLACK HILLS CORP       092113       AS8         GLOBAL SR~
## 16   853157       526 BLACK HILLS CORP       092113       AR0         GLOBAL SR~
## 17   911241       526 BLACK HILLS CORP       092113       AT6         GLOBAL NT 
## 18   992389       526 BLACK HILLS CORP       092113       AU3         GLOBAL NT 
## 19  1073654       526 BLACK HILLS CORP       092113       AV1         GLOBAL NT 
## # i 60 more variables: MATURITY <date>, SECURITY_LEVEL <chr>,
## #   SECURITY_PLEDGE <chr>, ENHANCEMENT <chr>, COUPON_TYPE <chr>,
## #   CONVERTIBLE <chr>, MTN <chr>, ASSET_BACKED <chr>, YANKEE <chr>,
## #   CANADIAN <chr>, OID <chr>, FOREIGN_CURRENCY <chr>, SLOB <chr>,
## #   ISSUE_OFFERED_GLOBAL <chr>, SETTLEMENT_TYPE <chr>, GROSS_SPREAD <dbl>,
## #   SELLING_CONCESSION <dbl>, REALLOWANCE <dbl>, COMP_NEG_EXCH_DEAL <chr>,
## #   RULE_415_REG <chr>, SEC_REG_TYPE1 <chr>, SEC_REG_TYPE2 <chr>, ...

The ISSUER_CUSIP in the Bond data has 6 digits, it contains a 0 and the first 5 digits of CUSIP_FULL in the CIK CUSIP file from Erik. When CUSIP contains letters, like in 92113B106 case, we have trouble finding the correct CUSIP. Because 092113 is a very different issuer than “VAN KAMPEN STRATEGIC GROWTH FD” as you can see in the previous example.

# CUSIP==46132L107 ISSUER NAME==INVESCO BOND FUND 

bond_data |> 
  filter(ISSUER_CUSIP=="046132")
## # A tibble: 0 x 66
## # i 66 variables: ISSUE_ID <dbl>, ISSUER_ID <dbl>,
## #   PROSPECTUS_ISSUER_NAME <chr>, ISSUER_CUSIP <chr>, ISSUE_CUSIP <chr>,
## #   ISSUE_NAME <chr>, MATURITY <date>, SECURITY_LEVEL <chr>,
## #   SECURITY_PLEDGE <chr>, ENHANCEMENT <chr>, COUPON_TYPE <chr>,
## #   CONVERTIBLE <chr>, MTN <chr>, ASSET_BACKED <chr>, YANKEE <chr>,
## #   CANADIAN <chr>, OID <chr>, FOREIGN_CURRENCY <chr>, SLOB <chr>,
## #   ISSUE_OFFERED_GLOBAL <chr>, SETTLEMENT_TYPE <chr>, GROSS_SPREAD <dbl>, ...
#920955101 
library(dplyr)
filtered_bond_data <- bond_data %>%
  filter(grepl("VAN KAMPEN", PROSPECTUS_ISSUER_NAME, ignore.case = TRUE))

print(filtered_bond_data)
## # A tibble: 2 x 66
##   ISSUE_ID ISSUER_ID PROSPECTUS_ISSUER_NAME  ISSUER_CUSIP ISSUE_CUSIP ISSUE_NAME
##      <dbl>     <dbl> <chr>                   <chr>        <chr>       <chr>     
## 1    23273      4399 VAN KAMPEN MERRITT COS~ 920942       AA7         SR SECD NT
## 2   434032     40259 VAN KAMPEN MUN TR       920919       305         PERP TR P~
## # i 60 more variables: MATURITY <date>, SECURITY_LEVEL <chr>,
## #   SECURITY_PLEDGE <chr>, ENHANCEMENT <chr>, COUPON_TYPE <chr>,
## #   CONVERTIBLE <chr>, MTN <chr>, ASSET_BACKED <chr>, YANKEE <chr>,
## #   CANADIAN <chr>, OID <chr>, FOREIGN_CURRENCY <chr>, SLOB <chr>,
## #   ISSUE_OFFERED_GLOBAL <chr>, SETTLEMENT_TYPE <chr>, GROSS_SPREAD <dbl>,
## #   SELLING_CONCESSION <dbl>, REALLOWANCE <dbl>, COMP_NEG_EXCH_DEAL <chr>,
## #   RULE_415_REG <chr>, SEC_REG_TYPE1 <chr>, SEC_REG_TYPE2 <chr>, ...
#81721102  BENEFICIAL CORP

bond_data |> 
  filter(ISSUER_CUSIP=="081721")
## # A tibble: 24 x 66
##    ISSUE_ID ISSUER_ID PROSPECTUS_ISSUER_NAME ISSUER_CUSIP ISSUE_CUSIP ISSUE_NAME
##       <dbl>     <dbl> <chr>                  <chr>        <chr>       <chr>     
##  1     2433       497 BENEFICIAL CORP        081721       AG7         DEB       
##  2     2434       497 BENEFICIAL CORP        081721       AH5         DEB       
##  3     2435       497 BENEFICIAL CORP        081721       AK8         DEB       
##  4     2436       497 BENEFICIAL CORP        081721       AL6         DEB       
##  5     2437       497 BENEFICIAL CORP        081721       AN2         DEB       
##  6     2438       497 BENEFICIAL CORP        081721       AP7         DEB       
##  7     2439       497 BENEFICIAL CORP        081721       AQ5         DEB       
##  8     2441       497 BENEFICIAL CORP        081721       AS1         DEB       
##  9     2444       497 BENEFICIAL CORP        081721       AV4         DEB       
## 10     2445       497 BENEFICIAL CORP        081721       AW2         DEB       
## # i 14 more rows
## # i 60 more variables: MATURITY <date>, SECURITY_LEVEL <chr>,
## #   SECURITY_PLEDGE <chr>, ENHANCEMENT <chr>, COUPON_TYPE <chr>,
## #   CONVERTIBLE <chr>, MTN <chr>, ASSET_BACKED <chr>, YANKEE <chr>,
## #   CANADIAN <chr>, OID <chr>, FOREIGN_CURRENCY <chr>, SLOB <chr>,
## #   ISSUE_OFFERED_GLOBAL <chr>, SETTLEMENT_TYPE <chr>, GROSS_SPREAD <dbl>,
## #   SELLING_CONCESSION <dbl>, REALLOWANCE <dbl>, COMP_NEG_EXCH_DEAL <chr>, ...
#44186104  ASHLAND GLOBAL HOLDINGS INC

bond_data |> 
  filter(ISSUER_CUSIP=="044186")
## # A tibble: 0 x 66
## # i 66 variables: ISSUE_ID <dbl>, ISSUER_ID <dbl>,
## #   PROSPECTUS_ISSUER_NAME <chr>, ISSUER_CUSIP <chr>, ISSUE_CUSIP <chr>,
## #   ISSUE_NAME <chr>, MATURITY <date>, SECURITY_LEVEL <chr>,
## #   SECURITY_PLEDGE <chr>, ENHANCEMENT <chr>, COUPON_TYPE <chr>,
## #   CONVERTIBLE <chr>, MTN <chr>, ASSET_BACKED <chr>, YANKEE <chr>,
## #   CANADIAN <chr>, OID <chr>, FOREIGN_CURRENCY <chr>, SLOB <chr>,
## #   ISSUE_OFFERED_GLOBAL <chr>, SETTLEMENT_TYPE <chr>, GROSS_SPREAD <dbl>, ...

Merg Impairment data and the bond data

Import CIK_CUSIP file

# load the CIK_CUSIP data where we have the CIK and CUSIP in right format
cik_cusip <- read_csv("C:/Users/jzhao/OneDrive - Tilburg University/Documents/R/Goodwill project/CIK_CUSIP.csv")
## New names:
## * `` -> `...15`
## * `` -> `...16`
## Warning: One or more parsing issues, call `problems()` on your data frame for details,
## e.g.:
##   dat <- vroom(...)
##   problems(dat)
## Rows: 31769 Columns: 16
## -- Column specification --------------------------------------------------------
## Delimiter: ","
## chr (9): COMPANY_FKEY, CoName, ISSUER_CUSIP, CUSIP_FULL, CUSIP, CIKDATE1, CI...
## dbl (4): CIK, ISSUE_CHECK, VALIDATED, LEN
## num (1): TMATCH
## lgl (2): ...15, ...16
## 
## i Use `spec()` to retrieve the full column specification for this data.
## i Specify the column types or set `show_col_types = FALSE` to quiet this message.
head(cik_cusip,10)
## # A tibble: 10 x 16
##    COMPANY_FKEY   CIK CoName     ISSUER_CUSIP CUSIP_FULL CUSIP CIKDATE1 CIKDATE2
##    <chr>        <dbl> <chr>      <chr>        <chr>      <chr> <chr>    <chr>   
##  1 0000000020      20 K TRON IN~ 048273       482730108  4827~ 2/14/19~ 4/9/2010
##  2 0000001750    1750 AAR CORP   036110       361105     36110 2/7/1994 2/6/2023
##  3 0000001761    1761 TRANZONIC~ 089412       894120104  8941~ 2/5/1997 2/10/19~
##  4 0000001761    1761 TRANZONIC~ 089412       894120203  8941~ 4/7/1997 4/7/1997
##  5 0000001800    1800 ABBOTT LA~ 028241       2824100    2824~ 2/14/19~ 2/14/20~
##  6 0000001853    1853 ABERDEEN ~ 030501       3050101    3050~ 3/19/20~ 5/27/20~
##  7 0000001923    1923 ABRAMS IN~ 037881       3788106    3788~ 2/7/1996 2/11/20~
##  8 0000001923    1923 SERVIDYNE~ 081765       81765M106  8176~ 5/19/20~ 8/31/20~
##  9 0000001961    1961 WORLDS CO~ 098191       981918105  9819~ 4/16/19~ 5/29/20~
## 10 0000001961    1961 WORLDS INC 098191       981918105  9819~ 4/16/19~ 5/29/20~
## # i 8 more variables: TMATCH <dbl>, ISSUER <chr>, ISSUE <chr>,
## #   ISSUE_CHECK <dbl>, VALIDATED <dbl>, LEN <dbl>, ...15 <lgl>, ...16 <lgl>

###Merge impairment data and the CIK_CUSIP data

#impairment_data <- impairment_data %>%
  #left_join(cik_cusip, by = "COMPANY_FKEY")
  
 #library(dplyr)
#impairment_data <- rename(impairment_data, ISSUER_CUSIP = cik_cusip$ISSUER_CUSIP) 
   
mergedt <- merge(impairment_data, cik_cusip, by= "COMPANY_FKEY") 

head(mergedt,10)
##    COMPANY_FKEY                        QUANTITATIVE_TAXONOMY_TEXT
## 1    0000001750                                         Inventory
## 2    0000001750                Other/unspecified/misc. impairment
## 3    0000001750                Other/unspecified/misc. impairment
## 4    0000001750                  PPE - Property, plant, equipment
## 5    0000001750                      Intangible Assets - Goodwill
## 6    0000001750 Accounts/loans receivable and investments - other
## 7    0000001750                  PPE - Property, plant, equipment
## 8    0000001750                                         Inventory
## 9    0000001750                Other/unspecified/misc. impairment
## 10   0000001750                                         Inventory
##           QUALTTIVE_TXNMY_TXT DT_OF_8K_NTIFICATION  FILE_DATE impairment_amount
## 1   |Discontinued Operations|                      2018-07-11          21200000
## 2   |Discontinued Operations|                      2018-07-11           2600000
## 3   |Discontinued Operations|                      2019-07-18          74100000
## 4                                                  2015-07-15          17700000
## 5                                                  2023-07-18           1000000
## 6                                                  2019-07-18           7600000
## 7  |Item 2.06 8-K Disclosure|           2020-06-29 2021-07-21           2600000
## 8  |Item 2.06 8-K Disclosure|           2020-06-29 2021-07-21           1400000
## 9                                                  2020-07-21          11800000
## 10                                                 2015-07-15           8900000
##    impairment_over_assets DATE_OF_8K_FORM_FKEY FORM_FKEY MTRL_IMPRMNT_FCT_KEY
## 1            0.0137859279                           10-K                27041
## 2            0.0016907270                           10-K                27042
## 3            0.0440259046                           10-K                27039
## 4            0.0114400207                           10-K                20029
## 5            0.0005116660                           10-K                39443
## 6            0.0045154774                           10-K                27052
## 7            0.0016930390                  8-K      10-K                33218
## 8            0.0009116364                  8-K      10-K                33216
## 9            0.0068852842                           10-K                29049
## 10           0.0057523268                           10-K                20030
##    ESTMATD_IMPCT_PRTX_INCM ESTMATD_IMPCT_NT_INCM MATCHQU_TSO_MARKCAP
## 1                -21200000                    NA          1618899328
## 2                 -2600000                    NA          1618899328
## 3                -74100000                    NA          1496129920
## 4                -17700000                    NA           841740672
## 5                 -1000000                    NA          2155836160
## 6                 -7600000                    NA          1496129920
## 7                 -2600000                    NA          1202694400
## 8                 -1400000                    NA          1202694400
## 9                -11800000                    NA           721388224
## 10                -8900000                    NA           841740672
##    MATCHQU_BALSH_ASSETS MATCHQU_BALSH_BOOK_VAL MATCHQU_INCMST_EBITDA_QTR
## 1            1537800000              784500000                  36500000
## 2            1537800000              784500000                  36500000
## 3            1683100000              780700000                  33600000
## 4            1547200000              697200000                  33800000
## 5            1954400000              881900000                  34600000
## 6            1683100000              780700000                  33600000
## 7            1535700000              866100000                  24200000
## 8            1535700000              866100000                  24200000
## 9            1713800000              767500000                  12300000
## 10           1547200000              697200000                  33800000
##    MATCHQU_INCMST_EBITDA_TTM MATCHQU_INCMST_NETINC_QTR
## 1                  147900000                  15100000
## 2                  147900000                  15100000
## 3                  138500000                   4400000
## 4                   34800000                  22900000
## 5                  161000000                   -600000
## 6                  138500000                   4400000
## 7                  133200000                  11500000
## 8                  133200000                  11500000
## 9                   65600000                 -14500000
## 10                  34800000                  22900000
##    MATCHQU_INCMST_NETINC_TTM
## 1                   20100000
## 2                   20100000
## 3                   -3200000
## 4                   18700000
## 5                   66900000
## 6                   -3200000
## 7                   61800000
## 8                   61800000
## 9                  -14500000
## 10                  18700000
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               MATERIAL_IMPAIRMENT_TEXT
## 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       2. Discontinued Operations      Our COCO business completed certain contracts in the second quarter of fiscal 2018. As the aircraft supporting these contracts were not placed on new contracts combined with the continued decline in operational tempo within the U.S. Department of Defense ("DoD") and an excess supply of aircraft assets in the market, we determined there was an impairment triggering event and tested the recoverability of our COCO assets. As a result, we recognized impairment and other charges of $54.2 million in the second quarter of fiscal 2018. The fair value of the aircraft and related assets was based on available market data for similar assets.
## 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       2. Discontinued Operations      Our COCO business completed certain contracts in the second quarter of fiscal 2018. As the aircraft supporting these contracts were not placed on new contracts combined with the continued decline in operational tempo within the U.S. Department of Defense ("DoD") and an excess supply of aircraft assets in the market, we determined there was an impairment triggering event and tested the recoverability of our COCO assets. As a result, we recognized impairment and other charges of $54.2 million in the second quarter of fiscal 2018. The fair value of the aircraft and related assets was based on available market data for similar assets.
## 3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        On March 15, 2019, we signed an agreement to sell certain contracts and assets of our COCO business. We expect the sale to close before the end of calendar 2019. In conjunction with this agreement and other expected asset sales, we recognized an impairment charge in discontinued operations of $74.1 million during the third quarter of fiscal 2019 reflecting the expected net proceeds to be received upon the completion of the sale transactions.
## 4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Aircraft may be classified as assets held for sale for more than one year as we continue to actively market the aircraft at reasonable prices. Certain aircraft types we currently have available for sale are specifically designed for particular functions which limits the marketability of those assets. We had eleven aircraft held for sale comprised of five fixed-wing and six rotary-wing aircraft at May 31, 2015 and nine aircraft held for sale comprised of five fixed-wing and four rotary-wing aircraft at May 31, 2014. During fiscal 2015, we recognized impairment charges of $8.9 million reflecting the decrease in fair value for certain aircraft held for sale and related rotable assets.  Equipment under Leases          Lease revenue is recognized as earned. The cost of the asset under lease is the original purchase price plus overhaul costs. Depreciation for aircraft is computed using the straight-line method over the estimated service life of the equipment. The balance sheet classification of equipment under lease is generally based on lease term, with fixed-term leases less than twelve months generally classified as short-term and all others generally classified as long-term.          Equipment on short-term lease includes aircraft engines and parts on or available for lease to satisfy customers' immediate short-term requirements. The leases are renewable with fixed terms, which generally vary from one to twelve months. In conjunction with our decision to exit certain product lines in our landing gear business, we recognized an impairment charge of $17.7 million related to rotable assets in fiscal 2015.
## 5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              In conjunction with the decision to exit certain product lines, we recognized rotable asset impairment charges of $1.0 million and $1.4 million in fiscal 2022 and 2021, respectively, in conjunction with reclassifying the rotable assets as inventory held for sale.
## 6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             In fiscal 2019, we recognized a provision for doubtful accounts of $12.4 million related to the bankruptcy of a European airline customer. The provision consisted of impairment of non-current contract assets of $7.6 million, allowance for doubtful accounts of $3.3 million, and other liabilities of $1.5 million.
## 7  Inventories  In conjunction with the decision to exit certain product lines and facilities, we recognized inventory impairment charges of $3.9 million in fiscal 2020.  We also recognized rotable asset impairment charges of $1.9 million in fiscal 2020 in conjunction with reclassifying the rotable assets as inventory held for sale.  In fiscal 2021, we recognized additional impairment charges of $1.4 million on these assets.  Impairment of Long-Lived Assets  We are required to test for impairment of long-lived assets whenever events or changes in circumstances indicate the carrying value of an asset may not be recoverable from its undiscounted cash flows.  When applying accounting standards addressing impairment of long-lived assets, we have utilized certain assumptions to estimate future undiscounted cash flows, including current and future sales volumes or lease rates, expected changes to cost structures, lease terms, residual values, market conditions, and trends impacting future demand.  Differences between actual results and the assumptions utilized by us when determining undiscounted cash flows could result in future impairments of long-lived assets.  We recognized pre-tax asset impairment charges related to our COCO business of $11.8 million and $74.1 million in fiscal 2020 and 2019, respectively, related to assets included in our COCO business, which is classified as a discontinued operation.  In our Expeditionary Services segment, we consolidated manufacturing facilities and recognized impairment and related charges of $2.6 million during fiscal 2021.  We maintain a significant inventory of rotable parts and equipment to service customer aircraft and components.  Portions of that inventory are used parts that are often exchanged with parts removed from aircraft or components, and are reworked to a useable condition.  We may have to recognize an impairment of our rotable parts and equipment if we discontinue using or servicing certain aircraft models or if an older aircraft model is phased-out in the industry.  In light of declines in commercial airline volumes and commercial program contract terminations, we evaluated future cash flows related to certain rotable assets supporting long-term programs and recognized asset impairment charges of $5.8 million and $1.9 million in fiscal 2021 and 2020, respectively.
## 8  Inventories  In conjunction with the decision to exit certain product lines and facilities, we recognized inventory impairment charges of $3.9 million in fiscal 2020.  We also recognized rotable asset impairment charges of $1.9 million in fiscal 2020 in conjunction with reclassifying the rotable assets as inventory held for sale.  In fiscal 2021, we recognized additional impairment charges of $1.4 million on these assets.  Impairment of Long-Lived Assets  We are required to test for impairment of long-lived assets whenever events or changes in circumstances indicate the carrying value of an asset may not be recoverable from its undiscounted cash flows.  When applying accounting standards addressing impairment of long-lived assets, we have utilized certain assumptions to estimate future undiscounted cash flows, including current and future sales volumes or lease rates, expected changes to cost structures, lease terms, residual values, market conditions, and trends impacting future demand.  Differences between actual results and the assumptions utilized by us when determining undiscounted cash flows could result in future impairments of long-lived assets.  We recognized pre-tax asset impairment charges related to our COCO business of $11.8 million and $74.1 million in fiscal 2020 and 2019, respectively, related to assets included in our COCO business, which is classified as a discontinued operation.  In our Expeditionary Services segment, we consolidated manufacturing facilities and recognized impairment and related charges of $2.6 million during fiscal 2021.  We maintain a significant inventory of rotable parts and equipment to service customer aircraft and components.  Portions of that inventory are used parts that are often exchanged with parts removed from aircraft or components, and are reworked to a useable condition.  We may have to recognize an impairment of our rotable parts and equipment if we discontinue using or servicing certain aircraft models or if an older aircraft model is phased-out in the industry.  In light of declines in commercial airline volumes and commercial program contract terminations, we evaluated future cash flows related to certain rotable assets supporting long-term programs and recognized asset impairment charges of $5.8 million and $1.9 million in fiscal 2021 and 2020, respectively.
## 9                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Impairment of Long-Lived Assets  We are required to test for impairment of long-lived assets whenever events or changes in circumstances indicate the carrying value of an asset may not be recoverable from its undiscounted cash flows.  When applying accounting standards addressing impairment of long-lived assets, we have utilized certain assumptions to estimate future undiscounted cash flows, including current and future sales volumes or lease rates, expected changes to cost structures, lease terms, residual values, market conditions, and trends impacting future demand.  Differences between actual results and the assumptions utilized by us when determining undiscounted cash flows could result in future impairments of long-lived assets.  We recognized pre-tax asset impairment charges related to our COCO business of $11.8 million, $74.1 million, and $64.0 million in fiscal 2020, 2019, and 2018, respectively, related to assets included in our COCO business, which is classified as a discontinued operation.      29             Table of Contents      We maintain a significant inventory of rotable parts and equipment to service customer aircraft and components.  Portions of that inventory are used parts that are often exchanged with parts removed from aircraft or components, and are reworked to a useable condition.  We may have to recognize an impairment of our rotable parts and equipment if we discontinue using or servicing certain aircraft models or if an older aircraft model is phased-out in the industry.  In conjunction with the decision to exit certain product lines, we recognized rotable asset impairment charges of $1.9 million in fiscal 2020.
## 10                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Aircraft may be classified as assets held for sale for more than one year as we continue to actively market the aircraft at reasonable prices. Certain aircraft types we currently have available for sale are specifically designed for particular functions which limits the marketability of those assets. We had eleven aircraft held for sale comprised of five fixed-wing and six rotary-wing aircraft at May 31, 2015 and nine aircraft held for sale comprised of five fixed-wing and four rotary-wing aircraft at May 31, 2014. During fiscal 2015, we recognized impairment charges of $8.9 million reflecting the decrease in fair value for certain aircraft held for sale and related rotable assets.  Equipment under Leases          Lease revenue is recognized as earned. The cost of the asset under lease is the original purchase price plus overhaul costs. Depreciation for aircraft is computed using the straight-line method over the estimated service life of the equipment. The balance sheet classification of equipment under lease is generally based on lease term, with fixed-term leases less than twelve months generally classified as short-term and all others generally classified as long-term.          Equipment on short-term lease includes aircraft engines and parts on or available for lease to satisfy customers' immediate short-term requirements. The leases are renewable with fixed terms, which generally vary from one to twelve months. In conjunction with our decision to exit certain product lines in our landing gear business, we recognized an impairment charge of $17.7 million related to rotable assets in fiscal 2015.
##    goodwill_impairment F8K  CIK   CoName ISSUER_CUSIP CUSIP_FULL CUSIP CIKDATE1
## 1                    0   0 1750 AAR CORP       036110     361105 36110 2/7/1994
## 2                    0   0 1750 AAR CORP       036110     361105 36110 2/7/1994
## 3                    0   0 1750 AAR CORP       036110     361105 36110 2/7/1994
## 4                    0   0 1750 AAR CORP       036110     361105 36110 2/7/1994
## 5                    1   0 1750 AAR CORP       036110     361105 36110 2/7/1994
## 6                    0   0 1750 AAR CORP       036110     361105 36110 2/7/1994
## 7                    0   1 1750 AAR CORP       036110     361105 36110 2/7/1994
## 8                    0   1 1750 AAR CORP       036110     361105 36110 2/7/1994
## 9                    0   0 1750 AAR CORP       036110     361105 36110 2/7/1994
## 10                   0   0 1750 AAR CORP       036110     361105 36110 2/7/1994
##    CIKDATE2 TMATCH   ISSUER ISSUE ISSUE_CHECK VALIDATED LEN ...15 ...16
## 1  2/6/2023    875 AAR CORP   COM           5         3   4    NA    NA
## 2  2/6/2023    875 AAR CORP   COM           5         3   4    NA    NA
## 3  2/6/2023    875 AAR CORP   COM           5         3   4    NA    NA
## 4  2/6/2023    875 AAR CORP   COM           5         3   4    NA    NA
## 5  2/6/2023    875 AAR CORP   COM           5         3   4    NA    NA
## 6  2/6/2023    875 AAR CORP   COM           5         3   4    NA    NA
## 7  2/6/2023    875 AAR CORP   COM           5         3   4    NA    NA
## 8  2/6/2023    875 AAR CORP   COM           5         3   4    NA    NA
## 9  2/6/2023    875 AAR CORP   COM           5         3   4    NA    NA
## 10 2/6/2023    875 AAR CORP   COM           5         3   4    NA    NA
#in total 305,175 observations

###Merge impairment data and bond data

finaldt <- merge(mergedt, Bdata, by= "ISSUER_CUSIP") 

head(finaldt,10)
##    ISSUER_CUSIP COMPANY_FKEY
## 1        001877   0001086600
## 2        001877   0001086600
## 3        001877   0001086600
## 4        001877   0001086600
## 5        001877   0001086600
## 6        001877   0001086600
## 7        002917   0001507385
## 8        002917   0001507385
## 9        002917   0001507385
## 10       002917   0001507385
##                                                QUANTITATIVE_TAXONOMY_TEXT
## 1                                        PPE - Property, plant, equipment
## 2                                        PPE - Property, plant, equipment
## 3                                        PPE - Property, plant, equipment
## 4                     Other long-lived assets, incl. capital leases, etc.
## 5                                        PPE - Property, plant, equipment
## 6                                            Intangible Assets - Goodwill
## 7                                        PPE - Property, plant, equipment
## 8                                            Intangible Assets - Goodwill
## 9  Accounts/loans receivable and investments - Investments in real estate
## 10                                       PPE - Property, plant, equipment
##                 QUALTTIVE_TXNMY_TXT DT_OF_8K_NTIFICATION  FILE_DATE
## 1  |Act of god - flood, fire, etc.|                      2021-02-23
## 2                                                        2016-02-26
## 3                                                        2020-02-20
## 4                                                        2013-03-01
## 5                                                        2019-02-22
## 6  |Act of god - flood, fire, etc.|                      2021-02-23
## 7                                                        2018-02-22
## 8                                                        2017-02-23
## 9                                                        2017-02-23
## 10                                                       2020-02-26
##    impairment_amount impairment_over_assets DATE_OF_8K_FORM_FKEY FORM_FKEY
## 1           25000000            0.011621529                           10-K
## 2          100130000            0.042275666                           10-K
## 3           15200000            0.006342792                           10-K
## 4           19000000            0.009502195                           10-K
## 5           40500000            0.016296934                           10-K
## 6          132000000            0.061361671                           10-K
## 7           50500000            0.003494377                           10-K
## 8          120900000            0.007872870                           10-K
## 9          182800000            0.011903727                           10-K
## 10          47100000            0.003419874                           10-K
##    MTRL_IMPRMNT_FCT_KEY ESTMATD_IMPCT_PRTX_INCM ESTMATD_IMPCT_NT_INCM
## 1                 32015               -25000000                    NA
## 2                 18533              -100130000                    NA
## 3                 32669               -15200000                    NA
## 4                 13677               -19000000                    NA
## 5                 25902               -40500000                    NA
## 6                 32014              -132000000                    NA
## 7                 23649               -50500000                    NA
## 8                 25118              -120900000                    NA
## 9                 25117              -182800000                    NA
## 10                32418               -47100000                    NA
##    MATCHQU_TSO_MARKCAP MATCHQU_BALSH_ASSETS MATCHQU_BALSH_BOOK_VAL
## 1            719924928           2151180000             1084220000
## 2            881344064           2368502000              810914000
## 3            405752736           2396421000             1051408000
## 4           2353803776           1999538000                     NA
## 5           2557552640           2485130000             1239506000
## 6            719924928           2151180000             1084220000
## 7           6794293760          14451789000             4347277000
## 8           8232564224          15356535000             6828968000
## 9           8232564224          15356535000             6828968000
## 10          4470923776          13772437000             3446076000
##    MATCHQU_INCMST_EBITDA_QTR MATCHQU_INCMST_EBITDA_TTM
## 1                         NA                        NA
## 2                         NA                        NA
## 3                         NA                        NA
## 4                         NA                        NA
## 5                         NA                        NA
## 6                         NA                        NA
## 7                  -71785000                -368047000
## 8                 -101094000                -416057000
## 9                 -101094000                -416057000
## 10                 255197000                 164715000
##    MATCHQU_INCMST_NETINC_QTR MATCHQU_INCMST_NETINC_TTM
## 1                   24748000                  40311000
## 2                   47310000                 247028000
## 3                 -144783000                 -21797000
## 4                  102937000                 355540000
## 5                  276428000                 487124000
## 6                   24748000                  40311000
## 7                   31795000                  49175000
## 8                   14438000                 -68339000
## 9                   14438000                 -68339000
## 10                  86808000                -282849000
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              MATERIAL_IMPAIRMENT_TEXT
## 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Goodwill impairment.  During 2020, we recorded a $132.0 million non-cash goodwill impairment charge associated with our Hamilton mine, primarily as the result of reduced expected production volumes due to weakened coal market conditions and low energy demand resulting in part from the COVID-19 pandemic.  Asset impairments.  During 2020, we recorded $25.0 million of non-cash asset impairment charges due to sealing our idled Gibson North mine, resulting in its permanent closure, and a decrease in the fair value of certain mining equipment and greenfield coal reserves as a result of weakened coal market conditions.  During 2019, we recorded an asset impairment charge of $15.2 million due to the cessation of production at our Dotiki mine.
## 2  4.                                      LONG-LIVED ASSET IMPAIRMENTS     During the fourth quarter of 2015, we idled our Onton and Gibson North mines in response to market conditions and continued increases in coal inventories at our mines and customer locations.  Our decision to idle these mines, as well as continued low coal prices and regulatory conditions, led to the conclusion that indicators of impairment were present and our carrying value for certain mines may not be fully recoverable.  During our assessment of the recoverability of the carrying value of our operating segments, we determined that we would likely not recover the carrying value of the net assets at MC Mining within our Appalachia segment and Onton within our Illinois Basin segment.  Accordingly, we estimated the fair values of the MC Mining and Onton net assets and then adjusted the carrying values to the fair values resulting in impairments of $19.5 million and $66.9 million, respectively.     The fair value of the assets was determined using a market approach and represents a Level 3 fair value measurement under the fair value hierarchy.  The fair value analysis was based on assumptions of marketability of coal properties in the current environment and the probability assessment of multiple sales scenarios based on observations of other recent mine sales.     During the fourth quarter of 2015 we determined that certain undeveloped coal reserves and related property in western Pennsylvania were no longer a core part of our foreseeable development plans and thus surrendered the lease for the properties in order to avoid the high holding costs of those reserves. We recorded an impairment charge of $3.0 million to our Appalachia segment during the quarter ended December 31, 2015 to remove advanced royalties associated with the lease from our consolidated balance sheet.     During the third quarter of 2015, we surrendered a lease agreement for certain undeveloped coal reserves and related property in western Kentucky.  We determined that coal reserves held under this lease agreement were no longer a core part of our foreseeable development plans.  As such, we surrendered the lease in order to avoid the high holding costs of those reserves.  We recorded an impairment charge of $10.7 million to our Illinois Basin segment to remove certain assets associated with the lease, including mineral rights, advanced royalties and mining permits from our consolidated balance sheet.
## 3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Asset impairment.  We recognized a non-cash asset impairment charge of $15.2 million at our Dotiki mine in 2019 as we ceased operations to shift production to our lower cost mines.
## 4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     5.        ASSET IMPAIRMENT CHARGE     We estimated the fair value of the Pontiki Assets and determined it was exceeded by the carrying value and accordingly, we recorded an asset impairment charge of $19.0 million in our Central Appalachian segment during the quarter ended September 30, 2012 to reduce the carrying value of the Pontiki Assets to their estimated fair value of $16.1 million. The fair value of the Pontiki Assets was determined using the market and cost valuation techniques and represents a Level 3 fair value measurement. The fair value analysis was based on the marketability of coal properties in the current market environment, discounted projected future cash flows, and estimated fair value of assets that could be sold or used at other operations. As these estimates incorporate certain assumptions, including replacement cost of equipment and marketability of coal reserves in the Central Appalachian region, and it is possible that the estimates may change in the future resulting in the need to adjust our determination of fair value. The asset impairment established a new cost basis on which depreciation, depletion and amortization is calculated for the Pontiki Assets.
## 5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          3.LONG-LIVED ASSET IMPAIRMENTS     In connection with our budgeting process in the fourth quarter, it was determined that, within our Illinois Basin segment, our Dotiki mine is expected to incur a reduction and related uncertainty in its economic mine life.  Accordingly, we adjusted the carrying value of Dotiki's assets of $85.3 million to their fair value of $51.0 million resulting in an impairment charge of $34.3 million.  Also within our Illinois Basin segment, a decrease in the fair value of an option entitling us to lease certain coal reserves resulted in an impairment charge of $6.2 million in the fourth quarter of 2018.
## 6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Goodwill impairment.  During 2020, we recorded a $132.0 million non-cash goodwill impairment charge associated with our Hamilton mine, primarily as the result of reduced expected production volumes due to weakened coal market conditions and low energy demand resulting in part from the COVID-19 pandemic.  Asset impairments.  During 2020, we recorded $25.0 million of non-cash asset impairment charges due to sealing our idled Gibson North mine, resulting in its permanent closure, and a decrease in the fair value of certain mining equipment and greenfield coal reserves as a result of weakened coal market conditions.  During 2019, we recorded an asset impairment charge of $15.2 million due to the cessation of production at our Dotiki mine.
## 7                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Note 4 &ndash; Real Estate Investments and Related Intangibles     Impairment of Real Estate Investments  The Company performs quarterly impairment review procedures, primarily through continuous monitoring of events and changes in circumstances that could indicate the carrying value of its real estate assets may not be recoverable.  As part of the Company&rsquo;s quarterly impairment review procedures and considering the factors discussed regarding the Company&rsquo;s policies on real estate impairment mentioned in Note 2 &ndash; Summary of Significant Accounting Policies, real estate assets and an investment in a property subject to a direct financing lease with carrying values totaling $161.9 million were deemed to be impaired and their carrying values were reduced to their estimated fair values of $111.4 million resulting in impairment charges of $50.5 million during the year ended December 31, 2017. The majority of the 2017 impairment charges relate to certain office, restaurant and other properties that, during 2017, management identified for potential sale or determined, based on discussions with the current tenants, will not be re-leased.
## 8                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Note 4 &ndash; Goodwill and Other Intangibles  Goodwill     The Company evaluates goodwill for impairment annually or more frequently when an event occurs or circumstances change that indicate the carrying value, by reporting unit, may not be recoverable. The analysis performed for the annual goodwill test during the years ended December 31, 2016, 2015 and 2014 resulted in impairment charges of $120.9 million, $139.7 million and $223.1 million, respectively, in the Cole Capital reporting unit. See Note 10 &ndash; Fair Value Measures for a discussion of the Company&rsquo;s fair value measurements regarding goodwill and intangible assets.  Note 5 &ndash; Real Estate Investments    Impairment of Real Estate Investments  The Company performs quarterly impairment review procedures, primarily through continuous monitoring of events and changes in circumstances that could indicate the carrying value of its real estate assets may not be recoverable.  During the year ended December 31, 2016, management identified certain properties for potential sale as part of its portfolio management strategy to reduce exposure to office properties. Additionally, a tenant of 59 restaurant properties filed for bankruptcy during the year ended December 31, 2016. As part of the Company&rsquo;s quarterly impairment review procedures and considering the factors mentioned above, real estate assets with carrying values totaling $668.2 million were deemed to be impaired and their carrying values were reduced to their estimated fair values of $485.4 million, resulting in impairment charges of $182.8 million during the year ended December 31, 2016. During the years ended December 31, 2015 and 2014, real estate assets with carrying values totaling $340.0 million and $199.5 million, respectively, were deemed to be impaired and their carrying values were reduced to their estimated fair values of $248.3 million and $99.0 million, respectively, resulting in impairment charges of $91.8 million and $100.5 million, respectively.
## 9                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Note 4 &ndash; Goodwill and Other Intangibles  Goodwill     The Company evaluates goodwill for impairment annually or more frequently when an event occurs or circumstances change that indicate the carrying value, by reporting unit, may not be recoverable. The analysis performed for the annual goodwill test during the years ended December 31, 2016, 2015 and 2014 resulted in impairment charges of $120.9 million, $139.7 million and $223.1 million, respectively, in the Cole Capital reporting unit. See Note 10 &ndash; Fair Value Measures for a discussion of the Company&rsquo;s fair value measurements regarding goodwill and intangible assets.  Note 5 &ndash; Real Estate Investments    Impairment of Real Estate Investments  The Company performs quarterly impairment review procedures, primarily through continuous monitoring of events and changes in circumstances that could indicate the carrying value of its real estate assets may not be recoverable.  During the year ended December 31, 2016, management identified certain properties for potential sale as part of its portfolio management strategy to reduce exposure to office properties. Additionally, a tenant of 59 restaurant properties filed for bankruptcy during the year ended December 31, 2016. As part of the Company&rsquo;s quarterly impairment review procedures and considering the factors mentioned above, real estate assets with carrying values totaling $668.2 million were deemed to be impaired and their carrying values were reduced to their estimated fair values of $485.4 million, resulting in impairment charges of $182.8 million during the year ended December 31, 2016. During the years ended December 31, 2015 and 2014, real estate assets with carrying values totaling $340.0 million and $199.5 million, respectively, were deemed to be impaired and their carrying values were reduced to their estimated fair values of $248.3 million and $99.0 million, respectively, resulting in impairment charges of $91.8 million and $100.5 million, respectively.
## 10                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Impairments  Impairments of $47.1 million recorded during the year ended December 31, 2019 relate to certain office, retail and restaurant properties that, during 2019, management identified for potential sale or determined, based on discussions with the current tenants, would not be re-leased by the tenant and the Company believes the property will not be leased to another tenant at a rental rate that supports the current book value.
##    goodwill_impairment F8K     CIK                                 CoName
## 1                    0   0 1086600          ALLIANCE RESOURCE PARTNERS LP
## 2                    0   0 1086600          ALLIANCE RESOURCE PARTNERS LP
## 3                    0   0 1086600          ALLIANCE RESOURCE PARTNERS LP
## 4                    0   0 1086600          ALLIANCE RESOURCE PARTNERS LP
## 5                    0   0 1086600          ALLIANCE RESOURCE PARTNERS LP
## 6                    1   0 1086600          ALLIANCE RESOURCE PARTNERS LP
## 7                    0   0 1507385 AMERICAN REALTY CAPITAL PROPERTIES INC
## 8                    1   0 1507385 AMERICAN REALTY CAPITAL PROPERTIES INC
## 9                    0   0 1507385 AMERICAN REALTY CAPITAL PROPERTIES INC
## 10                   0   0 1507385 AMERICAN REALTY CAPITAL PROPERTIES INC
##    CUSIP_FULL    CUSIP  CIKDATE1 CIKDATE2 TMATCH                         ISSUER
## 1   01877R108 01877R10 8/30/1999 7/3/2018    125 ALLIANCE RESOURCE PARTNERS L P
## 2   01877R108 01877R10 8/30/1999 7/3/2018    125 ALLIANCE RESOURCE PARTNERS L P
## 3   01877R108 01877R10 8/30/1999 7/3/2018    125 ALLIANCE RESOURCE PARTNERS L P
## 4   01877R108 01877R10 8/30/1999 7/3/2018    125 ALLIANCE RESOURCE PARTNERS L P
## 5   01877R108 01877R10 8/30/1999 7/3/2018    125 ALLIANCE RESOURCE PARTNERS L P
## 6   01877R108 01877R10 8/30/1999 7/3/2018    125 ALLIANCE RESOURCE PARTNERS L P
## 7   02917T104 02917T10 9/16/2011 3/9/2015    106    AMERICAN RLTY CAP PPTYS INC
## 8   02917T104 02917T10 9/16/2011 3/9/2015    106    AMERICAN RLTY CAP PPTYS INC
## 9   02917T104 02917T10 9/16/2011 3/9/2015    106    AMERICAN RLTY CAP PPTYS INC
## 10  02917T104 02917T10 9/16/2011 3/9/2015    106    AMERICAN RLTY CAP PPTYS INC
##                   ISSUE ISSUE_CHECK VALIDATED LEN ...15 ...16 ISSUE_ID
## 1  UNIT LTD PARTNER INT           8         3   7    NA    NA   982445
## 2  UNIT LTD PARTNER INT           8         3   7    NA    NA   982445
## 3  UNIT LTD PARTNER INT           8         3   7    NA    NA   982445
## 4  UNIT LTD PARTNER INT           8         3   7    NA    NA   982445
## 5  UNIT LTD PARTNER INT           8         3   7    NA    NA   982445
## 6  UNIT LTD PARTNER INT           8         3   7    NA    NA   982445
## 7                   COM           4         3   7    NA    NA      126
## 8                   COM           4         3   7    NA    NA      126
## 9                   COM           4         3   7    NA    NA      126
## 10                  COM           4         3   7    NA    NA      126
##    ISSUER_ID   PROSPECTUS_ISSUER_NAME ISSUE_CUSIP          ISSUE_NAME
## 1      51120         API GROUP DE INC         AA7 GTD SR NT RULE 144A
## 2      51120         API GROUP DE INC         AA7 GTD SR NT RULE 144A
## 3      51120         API GROUP DE INC         AA7 GTD SR NT RULE 144A
## 4      51120         API GROUP DE INC         AA7 GTD SR NT RULE 144A
## 5      51120         API GROUP DE INC         AA7 GTD SR NT RULE 144A
## 6      51120         API GROUP DE INC         AA7 GTD SR NT RULE 144A
## 7       5740 ABBEY NATL FIRST CAP B V         AA0          GTD SUB NT
## 8       5740 ABBEY NATL FIRST CAP B V         AA0          GTD SUB NT
## 9       5740 ABBEY NATL FIRST CAP B V         AA0          GTD SUB NT
## 10      5740 ABBEY NATL FIRST CAP B V         AA0          GTD SUB NT
##      MATURITY SECURITY_LEVEL GROSS_SPREAD OFFERING_DATE OFFERING_AMT
## 1  2029-07-15            SEN           NA    2021-06-15       350000
## 2  2029-07-15            SEN           NA    2021-06-15       350000
## 3  2029-07-15            SEN           NA    2021-06-15       350000
## 4  2029-07-15            SEN           NA    2021-06-15       350000
## 5  2029-07-15            SEN           NA    2021-06-15       350000
## 6  2029-07-15            SEN           NA    2021-06-15       350000
## 7  2004-10-15           SENS          6.5    1994-10-18       500000
## 8  2004-10-15           SENS          6.5    1994-10-18       500000
## 9  2004-10-15           SENS          6.5    1994-10-18       500000
## 10 2004-10-15           SENS          6.5    1994-10-18       500000
##    OFFERING_PRICE OFFERING_YIELD DELIVERY_DATE COVENANTS
## 1         100.000          4.125    2021-06-22         Y
## 2         100.000          4.125    2021-06-22         Y
## 3         100.000          4.125    2021-06-22         Y
## 4         100.000          4.125    2021-06-22         Y
## 5         100.000          4.125    2021-06-22         Y
## 6         100.000          4.125    2021-06-22         Y
## 7          99.767          8.234    1994-10-25         Y
## 8          99.767          8.234    1994-10-25         Y
## 9          99.767          8.234    1994-10-25         Y
## 10         99.767          8.234    1994-10-25         Y
#97,999 observations

Reorganize the final data

final_data<-select(finaldt,c(
  "COMPANY_FKEY",
  "CoName",
  "ISSUER_CUSIP",
  "ISSUE_NAME",
  "MATURITY",
  "SECURITY_LEVEL",
  "GROSS_SPREAD",
  "OFFERING_DATE",
  "OFFERING_AMT",
  "OFFERING_PRICE",
  "OFFERING_YIELD",
  "DELIVERY_DATE",
  "COVENANTS",
  "impairment_amount",
  "impairment_over_assets",
  "goodwill_impairment",
  "QUANTITATIVE_TAXONOMY_TEXT",
  "QUALTTIVE_TXNMY_TXT",
  "DT_OF_8K_NTIFICATION",
  "FILE_DATE",
  "DATE_OF_8K_FORM_FKEY",
  "FORM_FKEY",
  "MTRL_IMPRMNT_FCT_KEY",
  "ESTMATD_IMPCT_PRTX_INCM",
  "ESTMATD_IMPCT_NT_INCM",
  "MATCHQU_TSO_MARKCAP",
  "MATCHQU_BALSH_ASSETS",
  "MATCHQU_BALSH_BOOK_VAL",
  "MATCHQU_INCMST_EBITDA_QTR",
  "MATCHQU_INCMST_EBITDA_TTM",
  "MATCHQU_INCMST_NETINC_QTR",
  "MATCHQU_INCMST_NETINC_TTM",
  "MATERIAL_IMPAIRMENT_TEXT"
  )
)

head(final_data,10)
##    COMPANY_FKEY                                 CoName ISSUER_CUSIP
## 1    0001086600          ALLIANCE RESOURCE PARTNERS LP       001877
## 2    0001086600          ALLIANCE RESOURCE PARTNERS LP       001877
## 3    0001086600          ALLIANCE RESOURCE PARTNERS LP       001877
## 4    0001086600          ALLIANCE RESOURCE PARTNERS LP       001877
## 5    0001086600          ALLIANCE RESOURCE PARTNERS LP       001877
## 6    0001086600          ALLIANCE RESOURCE PARTNERS LP       001877
## 7    0001507385 AMERICAN REALTY CAPITAL PROPERTIES INC       002917
## 8    0001507385 AMERICAN REALTY CAPITAL PROPERTIES INC       002917
## 9    0001507385 AMERICAN REALTY CAPITAL PROPERTIES INC       002917
## 10   0001507385 AMERICAN REALTY CAPITAL PROPERTIES INC       002917
##             ISSUE_NAME   MATURITY SECURITY_LEVEL GROSS_SPREAD OFFERING_DATE
## 1  GTD SR NT RULE 144A 2029-07-15            SEN           NA    2021-06-15
## 2  GTD SR NT RULE 144A 2029-07-15            SEN           NA    2021-06-15
## 3  GTD SR NT RULE 144A 2029-07-15            SEN           NA    2021-06-15
## 4  GTD SR NT RULE 144A 2029-07-15            SEN           NA    2021-06-15
## 5  GTD SR NT RULE 144A 2029-07-15            SEN           NA    2021-06-15
## 6  GTD SR NT RULE 144A 2029-07-15            SEN           NA    2021-06-15
## 7           GTD SUB NT 2004-10-15           SENS          6.5    1994-10-18
## 8           GTD SUB NT 2004-10-15           SENS          6.5    1994-10-18
## 9           GTD SUB NT 2004-10-15           SENS          6.5    1994-10-18
## 10          GTD SUB NT 2004-10-15           SENS          6.5    1994-10-18
##    OFFERING_AMT OFFERING_PRICE OFFERING_YIELD DELIVERY_DATE COVENANTS
## 1        350000        100.000          4.125    2021-06-22         Y
## 2        350000        100.000          4.125    2021-06-22         Y
## 3        350000        100.000          4.125    2021-06-22         Y
## 4        350000        100.000          4.125    2021-06-22         Y
## 5        350000        100.000          4.125    2021-06-22         Y
## 6        350000        100.000          4.125    2021-06-22         Y
## 7        500000         99.767          8.234    1994-10-25         Y
## 8        500000         99.767          8.234    1994-10-25         Y
## 9        500000         99.767          8.234    1994-10-25         Y
## 10       500000         99.767          8.234    1994-10-25         Y
##    impairment_amount impairment_over_assets goodwill_impairment
## 1           25000000            0.011621529                   0
## 2          100130000            0.042275666                   0
## 3           15200000            0.006342792                   0
## 4           19000000            0.009502195                   0
## 5           40500000            0.016296934                   0
## 6          132000000            0.061361671                   1
## 7           50500000            0.003494377                   0
## 8          120900000            0.007872870                   1
## 9          182800000            0.011903727                   0
## 10          47100000            0.003419874                   0
##                                                QUANTITATIVE_TAXONOMY_TEXT
## 1                                        PPE - Property, plant, equipment
## 2                                        PPE - Property, plant, equipment
## 3                                        PPE - Property, plant, equipment
## 4                     Other long-lived assets, incl. capital leases, etc.
## 5                                        PPE - Property, plant, equipment
## 6                                            Intangible Assets - Goodwill
## 7                                        PPE - Property, plant, equipment
## 8                                            Intangible Assets - Goodwill
## 9  Accounts/loans receivable and investments - Investments in real estate
## 10                                       PPE - Property, plant, equipment
##                 QUALTTIVE_TXNMY_TXT DT_OF_8K_NTIFICATION  FILE_DATE
## 1  |Act of god - flood, fire, etc.|                      2021-02-23
## 2                                                        2016-02-26
## 3                                                        2020-02-20
## 4                                                        2013-03-01
## 5                                                        2019-02-22
## 6  |Act of god - flood, fire, etc.|                      2021-02-23
## 7                                                        2018-02-22
## 8                                                        2017-02-23
## 9                                                        2017-02-23
## 10                                                       2020-02-26
##    DATE_OF_8K_FORM_FKEY FORM_FKEY MTRL_IMPRMNT_FCT_KEY ESTMATD_IMPCT_PRTX_INCM
## 1                            10-K                32015               -25000000
## 2                            10-K                18533              -100130000
## 3                            10-K                32669               -15200000
## 4                            10-K                13677               -19000000
## 5                            10-K                25902               -40500000
## 6                            10-K                32014              -132000000
## 7                            10-K                23649               -50500000
## 8                            10-K                25118              -120900000
## 9                            10-K                25117              -182800000
## 10                           10-K                32418               -47100000
##    ESTMATD_IMPCT_NT_INCM MATCHQU_TSO_MARKCAP MATCHQU_BALSH_ASSETS
## 1                     NA           719924928           2151180000
## 2                     NA           881344064           2368502000
## 3                     NA           405752736           2396421000
## 4                     NA          2353803776           1999538000
## 5                     NA          2557552640           2485130000
## 6                     NA           719924928           2151180000
## 7                     NA          6794293760          14451789000
## 8                     NA          8232564224          15356535000
## 9                     NA          8232564224          15356535000
## 10                    NA          4470923776          13772437000
##    MATCHQU_BALSH_BOOK_VAL MATCHQU_INCMST_EBITDA_QTR MATCHQU_INCMST_EBITDA_TTM
## 1              1084220000                        NA                        NA
## 2               810914000                        NA                        NA
## 3              1051408000                        NA                        NA
## 4                      NA                        NA                        NA
## 5              1239506000                        NA                        NA
## 6              1084220000                        NA                        NA
## 7              4347277000                 -71785000                -368047000
## 8              6828968000                -101094000                -416057000
## 9              6828968000                -101094000                -416057000
## 10             3446076000                 255197000                 164715000
##    MATCHQU_INCMST_NETINC_QTR MATCHQU_INCMST_NETINC_TTM
## 1                   24748000                  40311000
## 2                   47310000                 247028000
## 3                 -144783000                 -21797000
## 4                  102937000                 355540000
## 5                  276428000                 487124000
## 6                   24748000                  40311000
## 7                   31795000                  49175000
## 8                   14438000                 -68339000
## 9                   14438000                 -68339000
## 10                  86808000                -282849000
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              MATERIAL_IMPAIRMENT_TEXT
## 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Goodwill impairment.  During 2020, we recorded a $132.0 million non-cash goodwill impairment charge associated with our Hamilton mine, primarily as the result of reduced expected production volumes due to weakened coal market conditions and low energy demand resulting in part from the COVID-19 pandemic.  Asset impairments.  During 2020, we recorded $25.0 million of non-cash asset impairment charges due to sealing our idled Gibson North mine, resulting in its permanent closure, and a decrease in the fair value of certain mining equipment and greenfield coal reserves as a result of weakened coal market conditions.  During 2019, we recorded an asset impairment charge of $15.2 million due to the cessation of production at our Dotiki mine.
## 2  4.                                      LONG-LIVED ASSET IMPAIRMENTS     During the fourth quarter of 2015, we idled our Onton and Gibson North mines in response to market conditions and continued increases in coal inventories at our mines and customer locations.  Our decision to idle these mines, as well as continued low coal prices and regulatory conditions, led to the conclusion that indicators of impairment were present and our carrying value for certain mines may not be fully recoverable.  During our assessment of the recoverability of the carrying value of our operating segments, we determined that we would likely not recover the carrying value of the net assets at MC Mining within our Appalachia segment and Onton within our Illinois Basin segment.  Accordingly, we estimated the fair values of the MC Mining and Onton net assets and then adjusted the carrying values to the fair values resulting in impairments of $19.5 million and $66.9 million, respectively.     The fair value of the assets was determined using a market approach and represents a Level 3 fair value measurement under the fair value hierarchy.  The fair value analysis was based on assumptions of marketability of coal properties in the current environment and the probability assessment of multiple sales scenarios based on observations of other recent mine sales.     During the fourth quarter of 2015 we determined that certain undeveloped coal reserves and related property in western Pennsylvania were no longer a core part of our foreseeable development plans and thus surrendered the lease for the properties in order to avoid the high holding costs of those reserves. We recorded an impairment charge of $3.0 million to our Appalachia segment during the quarter ended December 31, 2015 to remove advanced royalties associated with the lease from our consolidated balance sheet.     During the third quarter of 2015, we surrendered a lease agreement for certain undeveloped coal reserves and related property in western Kentucky.  We determined that coal reserves held under this lease agreement were no longer a core part of our foreseeable development plans.  As such, we surrendered the lease in order to avoid the high holding costs of those reserves.  We recorded an impairment charge of $10.7 million to our Illinois Basin segment to remove certain assets associated with the lease, including mineral rights, advanced royalties and mining permits from our consolidated balance sheet.
## 3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Asset impairment.  We recognized a non-cash asset impairment charge of $15.2 million at our Dotiki mine in 2019 as we ceased operations to shift production to our lower cost mines.
## 4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     5.        ASSET IMPAIRMENT CHARGE     We estimated the fair value of the Pontiki Assets and determined it was exceeded by the carrying value and accordingly, we recorded an asset impairment charge of $19.0 million in our Central Appalachian segment during the quarter ended September 30, 2012 to reduce the carrying value of the Pontiki Assets to their estimated fair value of $16.1 million. The fair value of the Pontiki Assets was determined using the market and cost valuation techniques and represents a Level 3 fair value measurement. The fair value analysis was based on the marketability of coal properties in the current market environment, discounted projected future cash flows, and estimated fair value of assets that could be sold or used at other operations. As these estimates incorporate certain assumptions, including replacement cost of equipment and marketability of coal reserves in the Central Appalachian region, and it is possible that the estimates may change in the future resulting in the need to adjust our determination of fair value. The asset impairment established a new cost basis on which depreciation, depletion and amortization is calculated for the Pontiki Assets.
## 5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          3.LONG-LIVED ASSET IMPAIRMENTS     In connection with our budgeting process in the fourth quarter, it was determined that, within our Illinois Basin segment, our Dotiki mine is expected to incur a reduction and related uncertainty in its economic mine life.  Accordingly, we adjusted the carrying value of Dotiki's assets of $85.3 million to their fair value of $51.0 million resulting in an impairment charge of $34.3 million.  Also within our Illinois Basin segment, a decrease in the fair value of an option entitling us to lease certain coal reserves resulted in an impairment charge of $6.2 million in the fourth quarter of 2018.
## 6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Goodwill impairment.  During 2020, we recorded a $132.0 million non-cash goodwill impairment charge associated with our Hamilton mine, primarily as the result of reduced expected production volumes due to weakened coal market conditions and low energy demand resulting in part from the COVID-19 pandemic.  Asset impairments.  During 2020, we recorded $25.0 million of non-cash asset impairment charges due to sealing our idled Gibson North mine, resulting in its permanent closure, and a decrease in the fair value of certain mining equipment and greenfield coal reserves as a result of weakened coal market conditions.  During 2019, we recorded an asset impairment charge of $15.2 million due to the cessation of production at our Dotiki mine.
## 7                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Note 4 &ndash; Real Estate Investments and Related Intangibles     Impairment of Real Estate Investments  The Company performs quarterly impairment review procedures, primarily through continuous monitoring of events and changes in circumstances that could indicate the carrying value of its real estate assets may not be recoverable.  As part of the Company&rsquo;s quarterly impairment review procedures and considering the factors discussed regarding the Company&rsquo;s policies on real estate impairment mentioned in Note 2 &ndash; Summary of Significant Accounting Policies, real estate assets and an investment in a property subject to a direct financing lease with carrying values totaling $161.9 million were deemed to be impaired and their carrying values were reduced to their estimated fair values of $111.4 million resulting in impairment charges of $50.5 million during the year ended December 31, 2017. The majority of the 2017 impairment charges relate to certain office, restaurant and other properties that, during 2017, management identified for potential sale or determined, based on discussions with the current tenants, will not be re-leased.
## 8                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Note 4 &ndash; Goodwill and Other Intangibles  Goodwill     The Company evaluates goodwill for impairment annually or more frequently when an event occurs or circumstances change that indicate the carrying value, by reporting unit, may not be recoverable. The analysis performed for the annual goodwill test during the years ended December 31, 2016, 2015 and 2014 resulted in impairment charges of $120.9 million, $139.7 million and $223.1 million, respectively, in the Cole Capital reporting unit. See Note 10 &ndash; Fair Value Measures for a discussion of the Company&rsquo;s fair value measurements regarding goodwill and intangible assets.  Note 5 &ndash; Real Estate Investments    Impairment of Real Estate Investments  The Company performs quarterly impairment review procedures, primarily through continuous monitoring of events and changes in circumstances that could indicate the carrying value of its real estate assets may not be recoverable.  During the year ended December 31, 2016, management identified certain properties for potential sale as part of its portfolio management strategy to reduce exposure to office properties. Additionally, a tenant of 59 restaurant properties filed for bankruptcy during the year ended December 31, 2016. As part of the Company&rsquo;s quarterly impairment review procedures and considering the factors mentioned above, real estate assets with carrying values totaling $668.2 million were deemed to be impaired and their carrying values were reduced to their estimated fair values of $485.4 million, resulting in impairment charges of $182.8 million during the year ended December 31, 2016. During the years ended December 31, 2015 and 2014, real estate assets with carrying values totaling $340.0 million and $199.5 million, respectively, were deemed to be impaired and their carrying values were reduced to their estimated fair values of $248.3 million and $99.0 million, respectively, resulting in impairment charges of $91.8 million and $100.5 million, respectively.
## 9                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Note 4 &ndash; Goodwill and Other Intangibles  Goodwill     The Company evaluates goodwill for impairment annually or more frequently when an event occurs or circumstances change that indicate the carrying value, by reporting unit, may not be recoverable. The analysis performed for the annual goodwill test during the years ended December 31, 2016, 2015 and 2014 resulted in impairment charges of $120.9 million, $139.7 million and $223.1 million, respectively, in the Cole Capital reporting unit. See Note 10 &ndash; Fair Value Measures for a discussion of the Company&rsquo;s fair value measurements regarding goodwill and intangible assets.  Note 5 &ndash; Real Estate Investments    Impairment of Real Estate Investments  The Company performs quarterly impairment review procedures, primarily through continuous monitoring of events and changes in circumstances that could indicate the carrying value of its real estate assets may not be recoverable.  During the year ended December 31, 2016, management identified certain properties for potential sale as part of its portfolio management strategy to reduce exposure to office properties. Additionally, a tenant of 59 restaurant properties filed for bankruptcy during the year ended December 31, 2016. As part of the Company&rsquo;s quarterly impairment review procedures and considering the factors mentioned above, real estate assets with carrying values totaling $668.2 million were deemed to be impaired and their carrying values were reduced to their estimated fair values of $485.4 million, resulting in impairment charges of $182.8 million during the year ended December 31, 2016. During the years ended December 31, 2015 and 2014, real estate assets with carrying values totaling $340.0 million and $199.5 million, respectively, were deemed to be impaired and their carrying values were reduced to their estimated fair values of $248.3 million and $99.0 million, respectively, resulting in impairment charges of $91.8 million and $100.5 million, respectively.
## 10                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Impairments  Impairments of $47.1 million recorded during the year ended December 31, 2019 relate to certain office, retail and restaurant properties that, during 2019, management identified for potential sale or determined, based on discussions with the current tenants, would not be re-leased by the tenant and the Company believes the property will not be leased to another tenant at a rental rate that supports the current book value.

Filter on goodwill impairments

# filter data with 8-K filing and goodwill impairment 
final_filtered_data <- final_data %>%
  filter(QUANTITATIVE_TAXONOMY_TEXT == "Intangible Assets - Goodwill" & DATE_OF_8K_FORM_FKEY == "8-K")

# View the filtered data
head(final_filtered_data,10)
##    COMPANY_FKEY         CoName ISSUER_CUSIP   ISSUE_NAME   MATURITY
## 1    0001163165 CONOCOPHILLIPS       020825    JR SUB NT 2010-12-31
## 2    0001163165 CONOCOPHILLIPS       020825   SR SUB DEB 1996-10-01
## 3    0001002910    AMEREN CORP       023608      RMKD NT 2007-05-15
## 4    0001002910    AMEREN CORP       023608 GLOBAL SR NT 2014-05-15
## 5    0001002910    AMEREN CORP       023608 GLOBAL SR NT 2024-09-15
## 6    0001002910    AMEREN CORP       023608 GLOBAL SR NT 2027-03-15
## 7    0001002910    AMEREN CORP       023608 GLOBAL SR NT 2028-03-15
## 8    0001002910    AMEREN CORP       023608 GLOBAL SR NT 2020-11-15
## 9    0001002910    AMEREN CORP       023608 GLOBAL SR NT 2026-02-15
## 10   0001002910    AMEREN CORP       023608 GLOBAL SR NT 2031-01-15
##    SECURITY_LEVEL GROSS_SPREAD OFFERING_DATE OFFERING_AMT OFFERING_PRICE
## 1            JUNS           NA    2003-08-04         1640       100.0000
## 2            SENS      42.5000    1986-10-03        50000       100.0000
## 3             SEN       0.0635    2005-02-10       345000       100.9628
## 4             SEN       6.0000    2009-05-12       425000        99.5050
## 5             SEN       6.0000    2019-09-11       450000        99.9670
## 6             SEN       6.0000    2021-11-15       500000        99.9810
## 7             SEN       6.2500    2021-02-24       450000        99.9080
## 8             SEN       6.0000    2015-11-17       350000        99.9770
## 9             SEN       6.5000    2015-11-17       350000        99.9110
## 10            SEN       6.5000    2020-03-31       800000        99.7630
##    OFFERING_YIELD DELIVERY_DATE COVENANTS impairment_amount
## 1         6.00000    2003-08-04         Y          2.54e+10
## 2        13.50000    1986-10-14         N          2.54e+10
## 3         3.83300    2005-02-15         N          3.00e+06
## 4         9.00012    2009-05-15         Y          3.00e+06
## 5         2.50706    2019-09-16         Y          3.00e+06
## 6         1.95356    2021-11-18         Y          3.00e+06
## 7         1.76401    2021-03-05         Y          3.00e+06
## 8         2.70500    2015-11-24         Y          3.00e+06
## 9         3.66100    2015-11-24         Y          3.00e+06
## 10        3.52700    2020-04-03         Y          3.00e+06
##    impairment_over_assets goodwill_impairment   QUANTITATIVE_TAXONOMY_TEXT
## 1            0.1773111532                   1 Intangible Assets - Goodwill
## 2            0.1773111532                   1 Intangible Assets - Goodwill
## 3            0.0001310101                   1 Intangible Assets - Goodwill
## 4            0.0001310101                   1 Intangible Assets - Goodwill
## 5            0.0001310101                   1 Intangible Assets - Goodwill
## 6            0.0001310101                   1 Intangible Assets - Goodwill
## 7            0.0001310101                   1 Intangible Assets - Goodwill
## 8            0.0001310101                   1 Intangible Assets - Goodwill
## 9            0.0001310101                   1 Intangible Assets - Goodwill
## 10           0.0001310101                   1 Intangible Assets - Goodwill
##           QUALTTIVE_TXNMY_TXT DT_OF_8K_NTIFICATION  FILE_DATE
## 1  |Item 2.06 8-K Disclosure|           2009-01-16 2009-02-25
## 2  |Item 2.06 8-K Disclosure|           2009-01-16 2009-02-25
## 3  |Item 2.06 8-K Disclosure|           2011-10-07 2012-02-28
## 4  |Item 2.06 8-K Disclosure|           2011-10-07 2012-02-28
## 5  |Item 2.06 8-K Disclosure|           2011-10-07 2012-02-28
## 6  |Item 2.06 8-K Disclosure|           2011-10-07 2012-02-28
## 7  |Item 2.06 8-K Disclosure|           2011-10-07 2012-02-28
## 8  |Item 2.06 8-K Disclosure|           2011-10-07 2012-02-28
## 9  |Item 2.06 8-K Disclosure|           2011-10-07 2012-02-28
## 10 |Item 2.06 8-K Disclosure|           2011-10-07 2012-02-28
##    DATE_OF_8K_FORM_FKEY FORM_FKEY MTRL_IMPRMNT_FCT_KEY ESTMATD_IMPCT_PRTX_INCM
## 1                   8-K      10-K                22864               -2.54e+10
## 2                   8-K      10-K                22864               -2.54e+10
## 3                   8-K      10-K                17590               -3.00e+06
## 4                   8-K      10-K                17590               -3.00e+06
## 5                   8-K      10-K                17590               -3.00e+06
## 6                   8-K      10-K                17590               -3.00e+06
## 7                   8-K      10-K                17590               -3.00e+06
## 8                   8-K      10-K                17590               -3.00e+06
## 9                   8-K      10-K                17590               -3.00e+06
## 10                  8-K      10-K                17590               -3.00e+06
##    ESTMATD_IMPCT_NT_INCM MATCHQU_TSO_MARKCAP MATCHQU_BALSH_ASSETS
## 1                     NA         63097884672          1.43251e+11
## 2                     NA         63097884672          1.43251e+11
## 3                     NA          7885637632          2.28990e+10
## 4                     NA          7885637632          2.28990e+10
## 5                     NA          7885637632          2.28990e+10
## 6                     NA          7885637632          2.28990e+10
## 7                     NA          7885637632          2.28990e+10
## 8                     NA          7885637632          2.28990e+10
## 9                     NA          7885637632          2.28990e+10
## 10                    NA          7885637632          2.28990e+10
##    MATCHQU_BALSH_BOOK_VAL MATCHQU_INCMST_EBITDA_QTR MATCHQU_INCMST_EBITDA_TTM
## 1              5.0481e+10                  4.29e+09                -3.177e+09
## 2              5.0481e+10                  4.29e+09                -3.177e+09
## 3              7.0120e+09                  3.39e+08                 1.615e+09
## 4              7.0120e+09                  3.39e+08                 1.615e+09
## 5              7.0120e+09                  3.39e+08                 1.615e+09
## 6              7.0120e+09                  3.39e+08                 1.615e+09
## 7              7.0120e+09                  3.39e+08                 1.615e+09
## 8              7.0120e+09                  3.39e+08                 1.615e+09
## 9              7.0120e+09                  3.39e+08                 1.615e+09
## 10             7.0120e+09                  3.39e+08                 1.615e+09
##    MATCHQU_INCMST_NETINC_QTR MATCHQU_INCMST_NETINC_TTM
## 1                   8.00e+08               -1.9688e+10
## 2                   8.00e+08               -1.9688e+10
## 3                  -4.03e+08                5.2000e+07
## 4                  -4.03e+08                5.2000e+07
## 5                  -4.03e+08                5.2000e+07
## 6                  -4.03e+08                5.2000e+07
## 7                  -4.03e+08                5.2000e+07
## 8                  -4.03e+08                5.2000e+07
## 9                  -4.03e+08                5.2000e+07
## 10                 -4.03e+08                5.2000e+07
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         MATERIAL_IMPAIRMENT_TEXT
## 1  Note 10&mdash;Impairments     Other Impairments  As a result of the economic downturn in the fourth quarter of 2008, the outlook for crude oil and natural gas prices, refining margins, and power spreads sharply deteriorated. In addition, current project economics in our E&amp;P segment resulted in revised capital spending plans. Because of these factors, certain E&amp;P, R&amp;M and Emerging Businesses properties no longer passed the undiscounted cash flow tests required by SFAS No. 144, &ldquo;Accounting for the Impairment or Disposal of Long-Lived Assets,&rdquo; and thus had to be written down to fair value. Consequently, we recorded property impairments of approximately $1,480 million, primarily consisting of:  Also during 2008, we recorded property impairments of:             &bull;     $63 million due to increased asset retirement obligations for properties at the end of their economic life, primarily for certain fields located in the North Sea.                     &bull;     $61 million associated with planned asset dispositions consisting mainly of $52 million for downstream assets in the United States.                     &bull;     $48 million for vacant office buildings in the United States.                     &bull;     $30 million for cancelled capital projects, primarily in our R&amp;M segment.           Accordingly, we recorded a noncash $7,410 million, before- and after-tax impairment, in our fourth-quarter 2008 results. This impairment had the effect of reducing our book value to $5,452 million, based on the market value of LUKOIL ADRs on December 31, 2008.  Note 9&mdash;Goodwill and Intangibles  Based on the above analysis, we concluded that a $25.4 billion before- and after-tax noncash impairment of the entire amount of recorded goodwill for the Worldwide E&amp;P reporting unit was required. This impairment was recorded in the fourth quarter of 2008.
## 2  Note 10&mdash;Impairments     Other Impairments  As a result of the economic downturn in the fourth quarter of 2008, the outlook for crude oil and natural gas prices, refining margins, and power spreads sharply deteriorated. In addition, current project economics in our E&amp;P segment resulted in revised capital spending plans. Because of these factors, certain E&amp;P, R&amp;M and Emerging Businesses properties no longer passed the undiscounted cash flow tests required by SFAS No. 144, &ldquo;Accounting for the Impairment or Disposal of Long-Lived Assets,&rdquo; and thus had to be written down to fair value. Consequently, we recorded property impairments of approximately $1,480 million, primarily consisting of:  Also during 2008, we recorded property impairments of:             &bull;     $63 million due to increased asset retirement obligations for properties at the end of their economic life, primarily for certain fields located in the North Sea.                     &bull;     $61 million associated with planned asset dispositions consisting mainly of $52 million for downstream assets in the United States.                     &bull;     $48 million for vacant office buildings in the United States.                     &bull;     $30 million for cancelled capital projects, primarily in our R&amp;M segment.           Accordingly, we recorded a noncash $7,410 million, before- and after-tax impairment, in our fourth-quarter 2008 results. This impairment had the effect of reducing our book value to $5,452 million, based on the market value of LUKOIL ADRs on December 31, 2008.  Note 9&mdash;Goodwill and Intangibles  Based on the above analysis, we concluded that a $25.4 billion before- and after-tax noncash impairment of the entire amount of recorded goodwill for the Worldwide E&amp;P reporting unit was required. This impairment was recorded in the fourth quarter of 2008.
## 3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               NOTE 17 &ndash; GOODWILL, IMPAIRMENT AND OTHER CHARGES     At the end of 2011, Genco ceased operations of its Meredosia and Hutsonville energy centers. The closure of these energy centers resulted in the elimination of 90 positions. Ameren and Genco each recorded the following pretax charges to earnings during 2011 related to the closure of these energy centers:           &Yuml;       a $26 million noncash impairment, representing the remaining net investment in both energy centers;                &Yuml;       a $4 million noncash impairment of materials and supplies; and                &Yuml;       a $4 million estimate for future cash severance costs, which will be substantially paid during the first quarter of 2012.             In July 2011, the EPA issued CSAPR, which created new allowances for SO2 and NOx emissions, and restricted the use of pre-existing SO2 and NOx allowances to the acid rain program and to the NOx budget trading program, respectively. As a result, observable market prices for existing emission allowances declined materially. Consequently, during 2011, Ameren and Genco recorded a noncash pretax impairment charge of $2 million and $1 million, respectively. Ameren Missouri recorded a $1 million impairment of its SO2 emission allowances by reducing a previously established regulatory liability relating to the SO2 emission allowances, which had no impact on earnings.
## 4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               NOTE 17 &ndash; GOODWILL, IMPAIRMENT AND OTHER CHARGES     At the end of 2011, Genco ceased operations of its Meredosia and Hutsonville energy centers. The closure of these energy centers resulted in the elimination of 90 positions. Ameren and Genco each recorded the following pretax charges to earnings during 2011 related to the closure of these energy centers:           &Yuml;       a $26 million noncash impairment, representing the remaining net investment in both energy centers;                &Yuml;       a $4 million noncash impairment of materials and supplies; and                &Yuml;       a $4 million estimate for future cash severance costs, which will be substantially paid during the first quarter of 2012.             In July 2011, the EPA issued CSAPR, which created new allowances for SO2 and NOx emissions, and restricted the use of pre-existing SO2 and NOx allowances to the acid rain program and to the NOx budget trading program, respectively. As a result, observable market prices for existing emission allowances declined materially. Consequently, during 2011, Ameren and Genco recorded a noncash pretax impairment charge of $2 million and $1 million, respectively. Ameren Missouri recorded a $1 million impairment of its SO2 emission allowances by reducing a previously established regulatory liability relating to the SO2 emission allowances, which had no impact on earnings.
## 5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               NOTE 17 &ndash; GOODWILL, IMPAIRMENT AND OTHER CHARGES     At the end of 2011, Genco ceased operations of its Meredosia and Hutsonville energy centers. The closure of these energy centers resulted in the elimination of 90 positions. Ameren and Genco each recorded the following pretax charges to earnings during 2011 related to the closure of these energy centers:           &Yuml;       a $26 million noncash impairment, representing the remaining net investment in both energy centers;                &Yuml;       a $4 million noncash impairment of materials and supplies; and                &Yuml;       a $4 million estimate for future cash severance costs, which will be substantially paid during the first quarter of 2012.             In July 2011, the EPA issued CSAPR, which created new allowances for SO2 and NOx emissions, and restricted the use of pre-existing SO2 and NOx allowances to the acid rain program and to the NOx budget trading program, respectively. As a result, observable market prices for existing emission allowances declined materially. Consequently, during 2011, Ameren and Genco recorded a noncash pretax impairment charge of $2 million and $1 million, respectively. Ameren Missouri recorded a $1 million impairment of its SO2 emission allowances by reducing a previously established regulatory liability relating to the SO2 emission allowances, which had no impact on earnings.
## 6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               NOTE 17 &ndash; GOODWILL, IMPAIRMENT AND OTHER CHARGES     At the end of 2011, Genco ceased operations of its Meredosia and Hutsonville energy centers. The closure of these energy centers resulted in the elimination of 90 positions. Ameren and Genco each recorded the following pretax charges to earnings during 2011 related to the closure of these energy centers:           &Yuml;       a $26 million noncash impairment, representing the remaining net investment in both energy centers;                &Yuml;       a $4 million noncash impairment of materials and supplies; and                &Yuml;       a $4 million estimate for future cash severance costs, which will be substantially paid during the first quarter of 2012.             In July 2011, the EPA issued CSAPR, which created new allowances for SO2 and NOx emissions, and restricted the use of pre-existing SO2 and NOx allowances to the acid rain program and to the NOx budget trading program, respectively. As a result, observable market prices for existing emission allowances declined materially. Consequently, during 2011, Ameren and Genco recorded a noncash pretax impairment charge of $2 million and $1 million, respectively. Ameren Missouri recorded a $1 million impairment of its SO2 emission allowances by reducing a previously established regulatory liability relating to the SO2 emission allowances, which had no impact on earnings.
## 7                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               NOTE 17 &ndash; GOODWILL, IMPAIRMENT AND OTHER CHARGES     At the end of 2011, Genco ceased operations of its Meredosia and Hutsonville energy centers. The closure of these energy centers resulted in the elimination of 90 positions. Ameren and Genco each recorded the following pretax charges to earnings during 2011 related to the closure of these energy centers:           &Yuml;       a $26 million noncash impairment, representing the remaining net investment in both energy centers;                &Yuml;       a $4 million noncash impairment of materials and supplies; and                &Yuml;       a $4 million estimate for future cash severance costs, which will be substantially paid during the first quarter of 2012.             In July 2011, the EPA issued CSAPR, which created new allowances for SO2 and NOx emissions, and restricted the use of pre-existing SO2 and NOx allowances to the acid rain program and to the NOx budget trading program, respectively. As a result, observable market prices for existing emission allowances declined materially. Consequently, during 2011, Ameren and Genco recorded a noncash pretax impairment charge of $2 million and $1 million, respectively. Ameren Missouri recorded a $1 million impairment of its SO2 emission allowances by reducing a previously established regulatory liability relating to the SO2 emission allowances, which had no impact on earnings.
## 8                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               NOTE 17 &ndash; GOODWILL, IMPAIRMENT AND OTHER CHARGES     At the end of 2011, Genco ceased operations of its Meredosia and Hutsonville energy centers. The closure of these energy centers resulted in the elimination of 90 positions. Ameren and Genco each recorded the following pretax charges to earnings during 2011 related to the closure of these energy centers:           &Yuml;       a $26 million noncash impairment, representing the remaining net investment in both energy centers;                &Yuml;       a $4 million noncash impairment of materials and supplies; and                &Yuml;       a $4 million estimate for future cash severance costs, which will be substantially paid during the first quarter of 2012.             In July 2011, the EPA issued CSAPR, which created new allowances for SO2 and NOx emissions, and restricted the use of pre-existing SO2 and NOx allowances to the acid rain program and to the NOx budget trading program, respectively. As a result, observable market prices for existing emission allowances declined materially. Consequently, during 2011, Ameren and Genco recorded a noncash pretax impairment charge of $2 million and $1 million, respectively. Ameren Missouri recorded a $1 million impairment of its SO2 emission allowances by reducing a previously established regulatory liability relating to the SO2 emission allowances, which had no impact on earnings.
## 9                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               NOTE 17 &ndash; GOODWILL, IMPAIRMENT AND OTHER CHARGES     At the end of 2011, Genco ceased operations of its Meredosia and Hutsonville energy centers. The closure of these energy centers resulted in the elimination of 90 positions. Ameren and Genco each recorded the following pretax charges to earnings during 2011 related to the closure of these energy centers:           &Yuml;       a $26 million noncash impairment, representing the remaining net investment in both energy centers;                &Yuml;       a $4 million noncash impairment of materials and supplies; and                &Yuml;       a $4 million estimate for future cash severance costs, which will be substantially paid during the first quarter of 2012.             In July 2011, the EPA issued CSAPR, which created new allowances for SO2 and NOx emissions, and restricted the use of pre-existing SO2 and NOx allowances to the acid rain program and to the NOx budget trading program, respectively. As a result, observable market prices for existing emission allowances declined materially. Consequently, during 2011, Ameren and Genco recorded a noncash pretax impairment charge of $2 million and $1 million, respectively. Ameren Missouri recorded a $1 million impairment of its SO2 emission allowances by reducing a previously established regulatory liability relating to the SO2 emission allowances, which had no impact on earnings.
## 10                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              NOTE 17 &ndash; GOODWILL, IMPAIRMENT AND OTHER CHARGES     At the end of 2011, Genco ceased operations of its Meredosia and Hutsonville energy centers. The closure of these energy centers resulted in the elimination of 90 positions. Ameren and Genco each recorded the following pretax charges to earnings during 2011 related to the closure of these energy centers:           &Yuml;       a $26 million noncash impairment, representing the remaining net investment in both energy centers;                &Yuml;       a $4 million noncash impairment of materials and supplies; and                &Yuml;       a $4 million estimate for future cash severance costs, which will be substantially paid during the first quarter of 2012.             In July 2011, the EPA issued CSAPR, which created new allowances for SO2 and NOx emissions, and restricted the use of pre-existing SO2 and NOx allowances to the acid rain program and to the NOx budget trading program, respectively. As a result, observable market prices for existing emission allowances declined materially. Consequently, during 2011, Ameren and Genco recorded a noncash pretax impairment charge of $2 million and $1 million, respectively. Ameren Missouri recorded a $1 million impairment of its SO2 emission allowances by reducing a previously established regulatory liability relating to the SO2 emission allowances, which had no impact on earnings.

We get a sample of 276 observations that reported goodwill impairment via 8K filings.

Then we can compare the 8K filing data and the bond issuing date.

final_filtered_data$diff_in_days<- difftime(final_filtered_data$OFFERING_DATE ,final_filtered_data$DT_OF_8K_NTIFICATION , units = c("days"))

head(final_filtered_data,10)
##    COMPANY_FKEY         CoName ISSUER_CUSIP   ISSUE_NAME   MATURITY
## 1    0001163165 CONOCOPHILLIPS       020825    JR SUB NT 2010-12-31
## 2    0001163165 CONOCOPHILLIPS       020825   SR SUB DEB 1996-10-01
## 3    0001002910    AMEREN CORP       023608      RMKD NT 2007-05-15
## 4    0001002910    AMEREN CORP       023608 GLOBAL SR NT 2014-05-15
## 5    0001002910    AMEREN CORP       023608 GLOBAL SR NT 2024-09-15
## 6    0001002910    AMEREN CORP       023608 GLOBAL SR NT 2027-03-15
## 7    0001002910    AMEREN CORP       023608 GLOBAL SR NT 2028-03-15
## 8    0001002910    AMEREN CORP       023608 GLOBAL SR NT 2020-11-15
## 9    0001002910    AMEREN CORP       023608 GLOBAL SR NT 2026-02-15
## 10   0001002910    AMEREN CORP       023608 GLOBAL SR NT 2031-01-15
##    SECURITY_LEVEL GROSS_SPREAD OFFERING_DATE OFFERING_AMT OFFERING_PRICE
## 1            JUNS           NA    2003-08-04         1640       100.0000
## 2            SENS      42.5000    1986-10-03        50000       100.0000
## 3             SEN       0.0635    2005-02-10       345000       100.9628
## 4             SEN       6.0000    2009-05-12       425000        99.5050
## 5             SEN       6.0000    2019-09-11       450000        99.9670
## 6             SEN       6.0000    2021-11-15       500000        99.9810
## 7             SEN       6.2500    2021-02-24       450000        99.9080
## 8             SEN       6.0000    2015-11-17       350000        99.9770
## 9             SEN       6.5000    2015-11-17       350000        99.9110
## 10            SEN       6.5000    2020-03-31       800000        99.7630
##    OFFERING_YIELD DELIVERY_DATE COVENANTS impairment_amount
## 1         6.00000    2003-08-04         Y          2.54e+10
## 2        13.50000    1986-10-14         N          2.54e+10
## 3         3.83300    2005-02-15         N          3.00e+06
## 4         9.00012    2009-05-15         Y          3.00e+06
## 5         2.50706    2019-09-16         Y          3.00e+06
## 6         1.95356    2021-11-18         Y          3.00e+06
## 7         1.76401    2021-03-05         Y          3.00e+06
## 8         2.70500    2015-11-24         Y          3.00e+06
## 9         3.66100    2015-11-24         Y          3.00e+06
## 10        3.52700    2020-04-03         Y          3.00e+06
##    impairment_over_assets goodwill_impairment   QUANTITATIVE_TAXONOMY_TEXT
## 1            0.1773111532                   1 Intangible Assets - Goodwill
## 2            0.1773111532                   1 Intangible Assets - Goodwill
## 3            0.0001310101                   1 Intangible Assets - Goodwill
## 4            0.0001310101                   1 Intangible Assets - Goodwill
## 5            0.0001310101                   1 Intangible Assets - Goodwill
## 6            0.0001310101                   1 Intangible Assets - Goodwill
## 7            0.0001310101                   1 Intangible Assets - Goodwill
## 8            0.0001310101                   1 Intangible Assets - Goodwill
## 9            0.0001310101                   1 Intangible Assets - Goodwill
## 10           0.0001310101                   1 Intangible Assets - Goodwill
##           QUALTTIVE_TXNMY_TXT DT_OF_8K_NTIFICATION  FILE_DATE
## 1  |Item 2.06 8-K Disclosure|           2009-01-16 2009-02-25
## 2  |Item 2.06 8-K Disclosure|           2009-01-16 2009-02-25
## 3  |Item 2.06 8-K Disclosure|           2011-10-07 2012-02-28
## 4  |Item 2.06 8-K Disclosure|           2011-10-07 2012-02-28
## 5  |Item 2.06 8-K Disclosure|           2011-10-07 2012-02-28
## 6  |Item 2.06 8-K Disclosure|           2011-10-07 2012-02-28
## 7  |Item 2.06 8-K Disclosure|           2011-10-07 2012-02-28
## 8  |Item 2.06 8-K Disclosure|           2011-10-07 2012-02-28
## 9  |Item 2.06 8-K Disclosure|           2011-10-07 2012-02-28
## 10 |Item 2.06 8-K Disclosure|           2011-10-07 2012-02-28
##    DATE_OF_8K_FORM_FKEY FORM_FKEY MTRL_IMPRMNT_FCT_KEY ESTMATD_IMPCT_PRTX_INCM
## 1                   8-K      10-K                22864               -2.54e+10
## 2                   8-K      10-K                22864               -2.54e+10
## 3                   8-K      10-K                17590               -3.00e+06
## 4                   8-K      10-K                17590               -3.00e+06
## 5                   8-K      10-K                17590               -3.00e+06
## 6                   8-K      10-K                17590               -3.00e+06
## 7                   8-K      10-K                17590               -3.00e+06
## 8                   8-K      10-K                17590               -3.00e+06
## 9                   8-K      10-K                17590               -3.00e+06
## 10                  8-K      10-K                17590               -3.00e+06
##    ESTMATD_IMPCT_NT_INCM MATCHQU_TSO_MARKCAP MATCHQU_BALSH_ASSETS
## 1                     NA         63097884672          1.43251e+11
## 2                     NA         63097884672          1.43251e+11
## 3                     NA          7885637632          2.28990e+10
## 4                     NA          7885637632          2.28990e+10
## 5                     NA          7885637632          2.28990e+10
## 6                     NA          7885637632          2.28990e+10
## 7                     NA          7885637632          2.28990e+10
## 8                     NA          7885637632          2.28990e+10
## 9                     NA          7885637632          2.28990e+10
## 10                    NA          7885637632          2.28990e+10
##    MATCHQU_BALSH_BOOK_VAL MATCHQU_INCMST_EBITDA_QTR MATCHQU_INCMST_EBITDA_TTM
## 1              5.0481e+10                  4.29e+09                -3.177e+09
## 2              5.0481e+10                  4.29e+09                -3.177e+09
## 3              7.0120e+09                  3.39e+08                 1.615e+09
## 4              7.0120e+09                  3.39e+08                 1.615e+09
## 5              7.0120e+09                  3.39e+08                 1.615e+09
## 6              7.0120e+09                  3.39e+08                 1.615e+09
## 7              7.0120e+09                  3.39e+08                 1.615e+09
## 8              7.0120e+09                  3.39e+08                 1.615e+09
## 9              7.0120e+09                  3.39e+08                 1.615e+09
## 10             7.0120e+09                  3.39e+08                 1.615e+09
##    MATCHQU_INCMST_NETINC_QTR MATCHQU_INCMST_NETINC_TTM
## 1                   8.00e+08               -1.9688e+10
## 2                   8.00e+08               -1.9688e+10
## 3                  -4.03e+08                5.2000e+07
## 4                  -4.03e+08                5.2000e+07
## 5                  -4.03e+08                5.2000e+07
## 6                  -4.03e+08                5.2000e+07
## 7                  -4.03e+08                5.2000e+07
## 8                  -4.03e+08                5.2000e+07
## 9                  -4.03e+08                5.2000e+07
## 10                 -4.03e+08                5.2000e+07
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         MATERIAL_IMPAIRMENT_TEXT
## 1  Note 10&mdash;Impairments     Other Impairments  As a result of the economic downturn in the fourth quarter of 2008, the outlook for crude oil and natural gas prices, refining margins, and power spreads sharply deteriorated. In addition, current project economics in our E&amp;P segment resulted in revised capital spending plans. Because of these factors, certain E&amp;P, R&amp;M and Emerging Businesses properties no longer passed the undiscounted cash flow tests required by SFAS No. 144, &ldquo;Accounting for the Impairment or Disposal of Long-Lived Assets,&rdquo; and thus had to be written down to fair value. Consequently, we recorded property impairments of approximately $1,480 million, primarily consisting of:  Also during 2008, we recorded property impairments of:             &bull;     $63 million due to increased asset retirement obligations for properties at the end of their economic life, primarily for certain fields located in the North Sea.                     &bull;     $61 million associated with planned asset dispositions consisting mainly of $52 million for downstream assets in the United States.                     &bull;     $48 million for vacant office buildings in the United States.                     &bull;     $30 million for cancelled capital projects, primarily in our R&amp;M segment.           Accordingly, we recorded a noncash $7,410 million, before- and after-tax impairment, in our fourth-quarter 2008 results. This impairment had the effect of reducing our book value to $5,452 million, based on the market value of LUKOIL ADRs on December 31, 2008.  Note 9&mdash;Goodwill and Intangibles  Based on the above analysis, we concluded that a $25.4 billion before- and after-tax noncash impairment of the entire amount of recorded goodwill for the Worldwide E&amp;P reporting unit was required. This impairment was recorded in the fourth quarter of 2008.
## 2  Note 10&mdash;Impairments     Other Impairments  As a result of the economic downturn in the fourth quarter of 2008, the outlook for crude oil and natural gas prices, refining margins, and power spreads sharply deteriorated. In addition, current project economics in our E&amp;P segment resulted in revised capital spending plans. Because of these factors, certain E&amp;P, R&amp;M and Emerging Businesses properties no longer passed the undiscounted cash flow tests required by SFAS No. 144, &ldquo;Accounting for the Impairment or Disposal of Long-Lived Assets,&rdquo; and thus had to be written down to fair value. Consequently, we recorded property impairments of approximately $1,480 million, primarily consisting of:  Also during 2008, we recorded property impairments of:             &bull;     $63 million due to increased asset retirement obligations for properties at the end of their economic life, primarily for certain fields located in the North Sea.                     &bull;     $61 million associated with planned asset dispositions consisting mainly of $52 million for downstream assets in the United States.                     &bull;     $48 million for vacant office buildings in the United States.                     &bull;     $30 million for cancelled capital projects, primarily in our R&amp;M segment.           Accordingly, we recorded a noncash $7,410 million, before- and after-tax impairment, in our fourth-quarter 2008 results. This impairment had the effect of reducing our book value to $5,452 million, based on the market value of LUKOIL ADRs on December 31, 2008.  Note 9&mdash;Goodwill and Intangibles  Based on the above analysis, we concluded that a $25.4 billion before- and after-tax noncash impairment of the entire amount of recorded goodwill for the Worldwide E&amp;P reporting unit was required. This impairment was recorded in the fourth quarter of 2008.
## 3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               NOTE 17 &ndash; GOODWILL, IMPAIRMENT AND OTHER CHARGES     At the end of 2011, Genco ceased operations of its Meredosia and Hutsonville energy centers. The closure of these energy centers resulted in the elimination of 90 positions. Ameren and Genco each recorded the following pretax charges to earnings during 2011 related to the closure of these energy centers:           &Yuml;       a $26 million noncash impairment, representing the remaining net investment in both energy centers;                &Yuml;       a $4 million noncash impairment of materials and supplies; and                &Yuml;       a $4 million estimate for future cash severance costs, which will be substantially paid during the first quarter of 2012.             In July 2011, the EPA issued CSAPR, which created new allowances for SO2 and NOx emissions, and restricted the use of pre-existing SO2 and NOx allowances to the acid rain program and to the NOx budget trading program, respectively. As a result, observable market prices for existing emission allowances declined materially. Consequently, during 2011, Ameren and Genco recorded a noncash pretax impairment charge of $2 million and $1 million, respectively. Ameren Missouri recorded a $1 million impairment of its SO2 emission allowances by reducing a previously established regulatory liability relating to the SO2 emission allowances, which had no impact on earnings.
## 4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               NOTE 17 &ndash; GOODWILL, IMPAIRMENT AND OTHER CHARGES     At the end of 2011, Genco ceased operations of its Meredosia and Hutsonville energy centers. The closure of these energy centers resulted in the elimination of 90 positions. Ameren and Genco each recorded the following pretax charges to earnings during 2011 related to the closure of these energy centers:           &Yuml;       a $26 million noncash impairment, representing the remaining net investment in both energy centers;                &Yuml;       a $4 million noncash impairment of materials and supplies; and                &Yuml;       a $4 million estimate for future cash severance costs, which will be substantially paid during the first quarter of 2012.             In July 2011, the EPA issued CSAPR, which created new allowances for SO2 and NOx emissions, and restricted the use of pre-existing SO2 and NOx allowances to the acid rain program and to the NOx budget trading program, respectively. As a result, observable market prices for existing emission allowances declined materially. Consequently, during 2011, Ameren and Genco recorded a noncash pretax impairment charge of $2 million and $1 million, respectively. Ameren Missouri recorded a $1 million impairment of its SO2 emission allowances by reducing a previously established regulatory liability relating to the SO2 emission allowances, which had no impact on earnings.
## 5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               NOTE 17 &ndash; GOODWILL, IMPAIRMENT AND OTHER CHARGES     At the end of 2011, Genco ceased operations of its Meredosia and Hutsonville energy centers. The closure of these energy centers resulted in the elimination of 90 positions. Ameren and Genco each recorded the following pretax charges to earnings during 2011 related to the closure of these energy centers:           &Yuml;       a $26 million noncash impairment, representing the remaining net investment in both energy centers;                &Yuml;       a $4 million noncash impairment of materials and supplies; and                &Yuml;       a $4 million estimate for future cash severance costs, which will be substantially paid during the first quarter of 2012.             In July 2011, the EPA issued CSAPR, which created new allowances for SO2 and NOx emissions, and restricted the use of pre-existing SO2 and NOx allowances to the acid rain program and to the NOx budget trading program, respectively. As a result, observable market prices for existing emission allowances declined materially. Consequently, during 2011, Ameren and Genco recorded a noncash pretax impairment charge of $2 million and $1 million, respectively. Ameren Missouri recorded a $1 million impairment of its SO2 emission allowances by reducing a previously established regulatory liability relating to the SO2 emission allowances, which had no impact on earnings.
## 6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               NOTE 17 &ndash; GOODWILL, IMPAIRMENT AND OTHER CHARGES     At the end of 2011, Genco ceased operations of its Meredosia and Hutsonville energy centers. The closure of these energy centers resulted in the elimination of 90 positions. Ameren and Genco each recorded the following pretax charges to earnings during 2011 related to the closure of these energy centers:           &Yuml;       a $26 million noncash impairment, representing the remaining net investment in both energy centers;                &Yuml;       a $4 million noncash impairment of materials and supplies; and                &Yuml;       a $4 million estimate for future cash severance costs, which will be substantially paid during the first quarter of 2012.             In July 2011, the EPA issued CSAPR, which created new allowances for SO2 and NOx emissions, and restricted the use of pre-existing SO2 and NOx allowances to the acid rain program and to the NOx budget trading program, respectively. As a result, observable market prices for existing emission allowances declined materially. Consequently, during 2011, Ameren and Genco recorded a noncash pretax impairment charge of $2 million and $1 million, respectively. Ameren Missouri recorded a $1 million impairment of its SO2 emission allowances by reducing a previously established regulatory liability relating to the SO2 emission allowances, which had no impact on earnings.
## 7                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               NOTE 17 &ndash; GOODWILL, IMPAIRMENT AND OTHER CHARGES     At the end of 2011, Genco ceased operations of its Meredosia and Hutsonville energy centers. The closure of these energy centers resulted in the elimination of 90 positions. Ameren and Genco each recorded the following pretax charges to earnings during 2011 related to the closure of these energy centers:           &Yuml;       a $26 million noncash impairment, representing the remaining net investment in both energy centers;                &Yuml;       a $4 million noncash impairment of materials and supplies; and                &Yuml;       a $4 million estimate for future cash severance costs, which will be substantially paid during the first quarter of 2012.             In July 2011, the EPA issued CSAPR, which created new allowances for SO2 and NOx emissions, and restricted the use of pre-existing SO2 and NOx allowances to the acid rain program and to the NOx budget trading program, respectively. As a result, observable market prices for existing emission allowances declined materially. Consequently, during 2011, Ameren and Genco recorded a noncash pretax impairment charge of $2 million and $1 million, respectively. Ameren Missouri recorded a $1 million impairment of its SO2 emission allowances by reducing a previously established regulatory liability relating to the SO2 emission allowances, which had no impact on earnings.
## 8                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               NOTE 17 &ndash; GOODWILL, IMPAIRMENT AND OTHER CHARGES     At the end of 2011, Genco ceased operations of its Meredosia and Hutsonville energy centers. The closure of these energy centers resulted in the elimination of 90 positions. Ameren and Genco each recorded the following pretax charges to earnings during 2011 related to the closure of these energy centers:           &Yuml;       a $26 million noncash impairment, representing the remaining net investment in both energy centers;                &Yuml;       a $4 million noncash impairment of materials and supplies; and                &Yuml;       a $4 million estimate for future cash severance costs, which will be substantially paid during the first quarter of 2012.             In July 2011, the EPA issued CSAPR, which created new allowances for SO2 and NOx emissions, and restricted the use of pre-existing SO2 and NOx allowances to the acid rain program and to the NOx budget trading program, respectively. As a result, observable market prices for existing emission allowances declined materially. Consequently, during 2011, Ameren and Genco recorded a noncash pretax impairment charge of $2 million and $1 million, respectively. Ameren Missouri recorded a $1 million impairment of its SO2 emission allowances by reducing a previously established regulatory liability relating to the SO2 emission allowances, which had no impact on earnings.
## 9                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               NOTE 17 &ndash; GOODWILL, IMPAIRMENT AND OTHER CHARGES     At the end of 2011, Genco ceased operations of its Meredosia and Hutsonville energy centers. The closure of these energy centers resulted in the elimination of 90 positions. Ameren and Genco each recorded the following pretax charges to earnings during 2011 related to the closure of these energy centers:           &Yuml;       a $26 million noncash impairment, representing the remaining net investment in both energy centers;                &Yuml;       a $4 million noncash impairment of materials and supplies; and                &Yuml;       a $4 million estimate for future cash severance costs, which will be substantially paid during the first quarter of 2012.             In July 2011, the EPA issued CSAPR, which created new allowances for SO2 and NOx emissions, and restricted the use of pre-existing SO2 and NOx allowances to the acid rain program and to the NOx budget trading program, respectively. As a result, observable market prices for existing emission allowances declined materially. Consequently, during 2011, Ameren and Genco recorded a noncash pretax impairment charge of $2 million and $1 million, respectively. Ameren Missouri recorded a $1 million impairment of its SO2 emission allowances by reducing a previously established regulatory liability relating to the SO2 emission allowances, which had no impact on earnings.
## 10                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              NOTE 17 &ndash; GOODWILL, IMPAIRMENT AND OTHER CHARGES     At the end of 2011, Genco ceased operations of its Meredosia and Hutsonville energy centers. The closure of these energy centers resulted in the elimination of 90 positions. Ameren and Genco each recorded the following pretax charges to earnings during 2011 related to the closure of these energy centers:           &Yuml;       a $26 million noncash impairment, representing the remaining net investment in both energy centers;                &Yuml;       a $4 million noncash impairment of materials and supplies; and                &Yuml;       a $4 million estimate for future cash severance costs, which will be substantially paid during the first quarter of 2012.             In July 2011, the EPA issued CSAPR, which created new allowances for SO2 and NOx emissions, and restricted the use of pre-existing SO2 and NOx allowances to the acid rain program and to the NOx budget trading program, respectively. As a result, observable market prices for existing emission allowances declined materially. Consequently, during 2011, Ameren and Genco recorded a noncash pretax impairment charge of $2 million and $1 million, respectively. Ameren Missouri recorded a $1 million impairment of its SO2 emission allowances by reducing a previously established regulatory liability relating to the SO2 emission allowances, which had no impact on earnings.
##       diff_in_days
## 1  -1991.9583 days
## 2  -8140.9583 days
## 3  -2429.9167 days
## 4   -877.9167 days
## 5   2896.0833 days
## 6   3692.0833 days
## 7   3428.0833 days
## 8   1502.0833 days
## 9   1502.0833 days
## 10  3098.0833 days

###Plot the frequency of these difference in time

ggplot(final_filtered_data, aes(x=diff_in_days))+
  geom_histogram()
## Don't know how to automatically pick scale for object of type <difftime>.
## Defaulting to continuous.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.