Readability of 10-K filings and firm's performance
//////////////////////////////////////
Objectives:
      1) Understand the usage of 10-K
      2) learn how to parse 10-K
      3) understand the Fog-index and learn how to calculate it for each 10-K filing
      4) Comments on your result

Source of data
      a) SEC EDGAR (Electronic Data Gathering , Analysis and Retrieval)
      b) I have all 10-K filings from Q1 1993 to Q2 2016 (the number of filings is 
           210,842 and the size is 440G)

Structure vs. unstructured data
    The unstructured information has a lion share of all information, 
    70% to 80% and it is reported that 80% of structured information 
    came from unstructured one. On the other-hand, SEC filings is an 
    important source of information (gold mine) since public companies, 
    certain insiders, and broker-dealers are required to make regular SEC filings. 

Text analysis
    Text is one of the most important informant belongs to unstructured 
       information. Text analysis, also called text mining, also referred 
       to as text data mining, roughly equivalent to text analytics, refers 
       to the process of deriving high-quality information from text. 
       For example, we could look at the frequency of each words, keywords, 
       number of lines, sentences, frequency of positive words vs. negative, 
       tone of the speech etc. For example, let s look at the top used words 
       by Reagan in 1994 and Obama 2008, see below. Which one belongs to Obama?

 Text analysis for finance and accounting
      Applying text analysis to finance and accounting does not have a long history. 
      Li (2008) shows that the readability of 10-K filings has a statistically 
      significant impact on the performance of a firm s subsequent performance. 
      The readability measure used by Li (2008) is call Fog index defined below. 

              Fog index=0.4*(n+p)                  (1)  

    where, n is the average number of words per sentence, while p is  
           the percentage of complex words.  A complex word is a word has 
           more than two syllables.

    Because of defining and measuring readability in the context of financial 
       disclosures becomes important with the increasing use of textual analysis 
       and the SEC s plain English initiative, Lougran and McDonald (2015) show 
       that  the Fog Index the most commonly applied readability measure is poorly 
       specified in financial applications. Of Fog s two components, one is 
       mis specified and the other is difficult to measure. They suggest to use 
       the size of 10-K filing as a simple readability proxy and show that it 
       outperforms the Fog Index. Another added advantage is that it does not 
       require document parsing, thus facilitates replication. 

    According to Loughran and McDonald (2014), there are 632 different forms.  
       On the other hand, most researchers used only one or two forms, such 
       as 10-K. Thus, the SEC filings  database  is a gold mine waiting to 
       be explored. 

 Reference
       Li, Feng, 2008, Annual report readability, current earnings, and earnings 
           persistence, Journal of Accounting and Economics 45, 221 247.

   source("http://datayyy.com/textAnalysis.txt")

//////////////////////////////////////