Announcement

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

  • Compute Instability of Industry Sales

    Hello,

    I am using stata to compute the instability of industry sales over the preceding 5 years (Bergh & Lawless, 1998). Because of paper-style, I have just a few details. I am following the instructions by Bergh & Lawless (1998): it was calculated 1. by regression analyses in which a variable for each year was regressed on a variable for net industry sales 2. five-year data were used for each regression (e.g. net industry sales values from 1985-1989 were used to predict instability in 1990).

    The basic equation is: yt = b0 + b1t + at, where y= industry sales, t= year and a=residual.

    Finally, instability is then defined as the standard error of the regression slope coefficient divided by the mean of industry sales.

    This procedure is very similar to the calculation of the environmental dimension `dynamism" defined by Dess & Beard (1984).

    I´ve tried to calculate instability step by step, but sometimes I am not sure, whether I has understood it correctly, especially the regression. So, hope you can help me.

    My code:

    * Step 1 - The regression and standard error of the regression slope coefficient

    collapse (sum)sale, by (SIC year)

    xtset SIC year

    save instability, replace

    rolling regress_sale_SE=_se[year], window(5): regress sale year

    save dynamism, replace

    *Five years´ data were used for each regression (industry sales 1985-1989 for instability in 1990)

    gen lead1= end + 1
    rename lead1 year
    sort SIC year

    save instability, replace


    *Step 2 - the mean-value of the dependent variable industry sales (over 5 year period)

    collapse (sum) sale, by (SIC year)

    ssc inst rangestat
    rangestat (mean) sale, interval (year -5 -1) by(SIC)

    sort SIC year
    save mean_values, replace

    *Merge
    merge 1:1 SIC year using "instability", keep(master match)
    drop _merge


    *coefficient divided by the mean value of dependant variable
    bysort SIC year: generate dynamism= regress_sale_SE/sale_mean

    save dynamism


    That´s the code so far, but I am very unsure.
    I am thankful for some advice.


  • #2
    Take some time to read the FAQ for good advice on how to post questions in a way that maximizes your chance of getting a helpful response. It may be that in your circles Bergh & Lawless (1988) is folklore. But this is a multi-disciplinary international forum. It is a safe bet that many of us have no idea what you're referring to. So at a minimum you need to post a full reference, one with enough information that an interested, motivated reader could actually look up. Beyond that, in this case, it sounds like you are asking whether or not your code implements some procedure that they describe in that reference. If so, it might be better still to just quote the relevant excerpt in your post (assuming it's not too long) so that people don't have access to that reference, or don't have the time or motivation to get it, might be able to respond helpfully.

    Meanwhile, a couple of short critiques of your code. These are not errors that will produce wrong results or cause a break in execution, but just needless complications:

    Code:
    gen lead1= end + 1
    rename lead1 year
    
    // IS EQUIVALENT TO JUST
    gen year = end + 1
    Code:
    ssc inst rangestat
    is something you should do before running this code, not in the midst of it. It is likely you will re-run this code several times--if not for production purposes, then just during the debugging phase. There is no reason to re-install -rangestat- every single time.

    The only exception to this I can think of is if you are writing this code to distribute to a large number of people, some of whom will already have -rangestat- installed but some of whom will not. In that case, it would be better to do this installation only if the program is not already installed. In that case, I would do it like this:
    Code:
    capture noisily rangestat (mean) sale, interval (year -5 -1) by(SIC)
    if c(rc) == 199 { // RETURN CODE FOR UNRECOGNIZED COMMAND
        capture noisily ssc install rangestat 
         if c(rc) != 0 { // ATTEMPTED INSTALLATION UNSUCCESSFUL IN SOME WAY
                display as error "Program rangestat.ado could not be installed"
                exit (`c(rc)')
          }
          else {
                rangestat (mean) sale, interval (year -5 -1) by(SIC)
          }
    }
    else if c(rc) != 0 { // rangestat WAS PRESENT BUT EXECUTED WITH ERROR
         exit(`c(rc)')
    }
    And in distributing this, be sure to warn the recipient that this code will install the -rangestat- package from SSC on their computer if they do not already have it. Otherwise the code could be considered malware.


    Comment


    • #3
      Dear Clyde,

      I will consider your advice and thanks a lot for the improved codes.

      One more question: Because you haven´t texted any errors, does the code above make sense to compute instability of industry sales?

      Cheers

      Comment


      • #4
        Because you haven´t texted any errors, does the code above make sense to compute instability of industry sales?
        I don't know. I'm an epidemiologist and this is way out of my domain of knowledge. I don't know what conventional definitions of instability prevail in your discipline, or, if there aren't any, what constraints might apply to any suitable measure of that construct. I also don't know what the Bergh & Lawless article you want to emulate is, and, in any case, I probably wouldn't have access to it anyway.

        There are people on this forum who work in finance or econometrics, and perhaps one of them knows.

        Comment


        • #5
          Sabrina, did you ever figure out whether your code was correct?

          Comment

          Working...
          X