Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • New version of ASTILE : addition of quantile criterion

    Hello everyone
    There is an updated version of astile (version 3.2.1) on the SSC, thanks to Kit Baum. To install or update,
    Code:
    ssc install astile, replace
    This version has two updates:

    1. Addition of option qc
    2. A bug fix that would cause an error if there were more than 10 million observations

    I would like to show the usefulness and use of option qc.



    Option qc

    qc(string) : qc is an abbreviation for qunatile criterion. This option can be used if the qunatile breakpoints need to be based on a subset of the data, and then observations in the entire data set (off course in the toused sample as created by the [if] [in] options) are to be assigned to these break points.

    Such calculations can be frequently found in testing asset pricing models. It is standard in the field of finance to work with portfolios of stocks. Researchers form portfolios of stocks on the basis of firm-specific characteristics such size of the firms, book-to-market ratio, investments, etc. Several studies have used a sub-sample of firms to make decile breakpoints and then assign rest of the firms to these decile groups. For example, one might form decile portfolios by ranking NYSE-listed stocks on their market capitalization and define the decile breakpoints, and then assign all publicly traded stocks on the NYSE, AMEX, and NASDAQ to one of these decile groups.

    Implementing the above with astile is very easy. Let us use an example and see how it can be done. We shall first generate a dummy data set for our practice. We shall create 500 firms, 100 years from 1951 to 2050; three stock exchanges where these 500 firms are listed, these exchanges are NYSE, AMEX, and NASDAQ; and finally, generate market-capitalization (MarkCap) that varies for each firm in each year.
    Code:
           clear
            
            set obs 500
            
            gen company=_n
            
            expand 100
            
            bys company: gen year=_n+1950
            
            bys company: gen xc=mod(company, 3)+1
            
            gen exchange = cond(xc==1, "NYSE", cond(xc==2, "AMEX", "NASDAQ"))
                    
            gen MarkCap=uniform()*10000
    So, we shall make MarkCap-based decile breakpoints from NYSE-listed firms and assign all stocks (let they be listed at NYSE, AMEX, or NASDAQ) to these decile groups.

    Code:
    bys year: astile size = MarkCap, qc(exchange =="NYSE")  nq(10)
    Regards
    --------------------------------------------------
    Attaullah Shah, PhD.
    Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    FinTechProfessor.com
    https://asdocx.com
    Check out my asdoc program, which sends outputs to MS Word.
    For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.
Working...
X