MarketStatistics           package:fEcofin           R Documentation

_C_I_A _F_a_c_t_b_o_o_k

_D_e_s_c_r_i_p_t_i_o_n:

     A collection and description of functions to extract  financial
     and economic market statistics from the data available in the CIA
     World Factbook and from the exchange data collected by the World
     Federation of  Stock Exchanges. 

     The functions are:

       'ciaCountries'    Returns a list of CIA country codes,
       'ciaIndicators'   Returns a list of CIA indicator codes,
       'ciaByCountry'    Returns all Indicators by country,
       'ciaByIndicator'  Returns for all countries indicator ranking.

     To load statistics from the WFE:

       'data(wfe1)'  Market capitalization of domestic companies,
       'data(wfe2)'  Total number of companies with shares listed,
       'data(wfe3)'  Total value of share trading,
       'data(wfe4)'  Market value of bonds listed,
       'data(wfe5)'  Total value of bond trading, and
       'data(wfe6)'  Price earning ratio an gross dividend yield.

_U_s_a_g_e:

     ciaCountries()
     ciaIndicators()

     ciaByCountry(code = "CH", from = FALSE, names = FALSE, details = FALSE)
     ciaByIndicator(code = 2001, from = FALSE, details = FALSE)

     ## S3 method for class 'ciaCountries':
     print(x, ...)
     ## S3 method for class 'ciaIndicators':
     print(x, ...)

_A_r_g_u_m_e_n_t_s:

    code: [ciaByCountry] - 
           a character string denoting the country code. 
           [ciaByIndicator] - 
           a character string or integer denoting the indicator code. 

 details: a logical flag. Should details be printed? By default 
          'FALSE'. 

    from: a logical flag. If set to 'TRUE' an additional column will be
          returned with the information when the data were recorded. 

   names: a logical flag. If set to 'TRUE"' then the full names of the
          countries will be returned in an additional column 

       x: x an object of class 'ciaCountries' or  'ciaIndicators' as
          returned by the functions  'ciaCountry' or 'ciaIndicator',
          respectively. 

     ...: arguments to be past to the 'print' method. 

_D_e_t_a_i_l_s:

     Financial and economic market statistics can be found at several 
     web pages for free. The "OECD Factbook" from the 'Organisation for
     Economic Co-operation and Development', _www.oecd.org_, "The World
     Factbook" from the 'Central Intelligence Agency' of the US,
     _www.cia.gov_, and the "Penn World Tables" from the 'Center for
     International Comparisons' at University of Pennsylvania,
     _pwt.econ.upenn.edu_, offer sources of economic, environmental and
     social indicators for the world's core economies.

     Statistical data from the exchanges around the world can be
     obtained from the 'World Federation of Stock Exchanges',
     _www.fibv.com_.

     Further sources of statistical data can be found on the web pages
     of the 'Bank for International Settlement', _www.bis.org_, and on
     the web pages of the 'International Monetary Fund', _www.imf.org_.

_V_a_l_u_e:

     'ciaCountries' 
      returns a data frame with countries and contry codes. 

     'ciaIndicators' 
      returns a data frame with indicator codes. 

     'ciaByCountry' 
      returns a data frame with indicators by country. 

     'ciaByIndicator' 
      returns a data frame with ranked data for a given indicator.

_A_u_t_h_o_r(_s):

     Diethelm Wuertz for the Rmetrics R-port.

_R_e_f_e_r_e_n_c_e_s:

     CIA, 2004,  _CIA Factbbook 2004_,
     http://www.cia.gov/cia/publications/factbook.

     WFE, 2004, _World Federation of Stock Exchanges, Focus 2004_,
     http://www.world-exchanges.org.

_E_x_a_m_p_l_e_s:

     ## SOURCE("fBasics.1A-MarketStatistics")

     ## Pie Chart from CIA Oil Production Indicator (Code 2173): 
        # Search for Code:
        ciaIndicators()
        # Create Pie Chart:
        OilProduction = as.integer(as.vector(ciaByIndicator(2173)[2:11, 2]))
        names(OilProduction) = as.vector(ciaByIndicator(2173)[2:11,1])
        OilProduction 
        pie(OilProduction,col = rainbow(10))
        title(main = "Oil Production 2004\n bbl/day")
        mtext("Source: CIA World Factbook", side = 1)

     ## Barplot from WFE Capitalization Statistics:
        # Extract Capitalization of/at:
        # NYSE: 7, Tokyo: 37, London: 22, Frankfurt: 15
        # 1991 - 2003 triannual: 3,6,9,12,15
        data(wfe1)
        Table =t(wfe1[c(7,37,22,15),c(3,6,9,12,15)])/1e6
        colnames(Table) = c("NewYork", "Tokyo", "London", "Frankfurt")
        rownames(Table) = as.character(seq(1991, 2003, by = 3))
        Table
        # Create Barplot:
        barplot(Table, beside = TRUE, legend = rownames(Table),
          col = c("lightblue", "mistyrose", "lightcyan", "lavender", "cornsilk"))
        title(main = "Stock Market Capitalization\n 1991 - 2003")
        mtext("Source: World Federation of Exchanges", side = 4, 
          line = -2, cex = 0.7) 

