Announcement

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

  • Creating a group containing certain variables

    Hello all,

    Possibly a rudimentary question here. I am looking to define a range of variables as one group. I would like to be able to call this group to quickly use some of the following commands:

    -tabstat groupvars
    -xtreg depvar groupvars
    -lasso depvra groupvars

    etc.

    Is there anyway this can be achieved (I tried creating a local but this wont work for some of the above commands)

    Let me know if you need any more information.

    Thanks,
    Kayleigh






  • #2
    Yeah which variables are we talking about? Please use dataex to present your data. And show the exact code you used.

    Comment


    • #3
      Well the question could apply to any set of hypothetical variables, but as an example here are some of the potential variables that could be included:

      Code:
      * Example generated by -dataex-. For more info, type help dataex
      clear
      input double(SALES_REV_TURN CF_FREE_CASH_FLOW BS_TOT_ASSET PROF_MARGIN EBITDA RETURN_ON_ASSET RETURN_ON_INV_CAPITAL CUR_RATIO CASH_RATIO TOT_DEBT_TO_TOT_ASSET TOT_DEBT_TO_TOT_EQY ST_AND_LT_DEBT)
      1074689941.40625 -73508972.16796875 2902968017.578125 2.1689976399556556 458955001.8310547  .8211364683155831 2.2912532569232433 .8943568083182852 .15886877171636601 43.63265530790525  85.43066393044381 1266642028.8085938
      1074689941.40625 -73508972.16796875 2902968017.578125 2.1689976399556556 458955001.8310547  .8211364683155831 2.2912532569232433 .8943568083182852 .15886877171636601 43.63265530790525  85.43066393044381 1266642028.8085938
      1074689941.40625 -73508972.16796875 2902968017.578125 2.1689976399556556 458955001.8310547  .8211364683155831 2.2912532569232433 .8943568083182852 .15886877171636601 43.63265530790525  85.43066393044381 1266642028.8085938
            1536813000          245312000        3675295000  10.72954224098833         426295000 4.6865725134353875   4.72308003954694 2.795594252972569 1.9620095913195283 5.562465053825611 7.4977408158295455          204437000
                     .                  .                 .                  .                 .                  .                  .                 .                  .                 .                  .                  .
      end

      This is what I have already tried-

      . *Summary statistics

      . local financials logEBITDA logFCF logST_AND_LT_DEBT logTOT_ASSETS logREVENUE SALES_REV_TURN CF_FREE_CASH
      > _FLOW BS_DEBT_EBITDA BS_TOT_ASSET PROF_MARGIN EBITDA RETURN_ON_ASSET RETURN_ON_INV_CAPITAL CUR_RATIO CASH
      > _RATIO TOT_DEBT_TO_TOT_ASSET TOT_DEBT_TO_TOT_EQY ST_AND_LT_DEBT

      .
      end of do-file

      . do "C:\Users\Kris\AppData\Local\Temp\STD5320_000000.t mp"

      . tabstat `financials', col(stat) stat(mean p50 p5 p95 sd ) format(%20.2f)
      varlist required

      Thank you!

      Comment


      • #4
        The local needs to be defined before you run the command, otherwise it is read as empty. Note that locals are local to the do-file or program in which they are defined. For more on this, see https://journals.sagepub.com/doi/abs...36867X20931028. So you need both



        Code:
        local financials logEBITDA logFCF logST_AND_LT_DEBT logTOT_ASSETS logREVENUE SALES_REV_TURN CF_FREE_CASH_FLOW BS_DEBT_EBITDA BS_TOT_ASSET PROF_MARGIN EBITDA RETURN_ON_ASSET RETURN_ON_INV_CAPITAL CUR_RATIO CASH_RATIO TOT_DEBT_TO_TOT_ASSET TOT_DEBT_TO_TOT_EQY ST_AND_LT_DEBT
        
        tabstat `financials', col(stat) stat(mean p50 p5 p95 sd ) format(%20.2f)

        Comment

        Working...
        X