Announcement

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

  • Omitted Variable Because of Collinearity

    Hello everyone, I hope everyone is doing well!

    I'm currently trying to do a regression of several dependent variables and independent variables. The issue I'm currently facing is that Stata will always omit my independent variable, Volume, because of collinearity. I tried to regress Volume to other independent variables without changing the model but have found no clue as to what needs to be done.

    I have attached the excel files used in the regression. The file 'ACES Daily' contains the raw data and my calculation of the them, and the file 'Compiled' is the excel file used in the regression which simply contains the data written in bold at the bottom of 'ACES Daily'.

    Help would be very much appreciated!
    Have a great day!

    Warmest regards,
    Robby

    Edit: I forgot to include the model, it is now attached. Liq being the dependent variables: RS, RtoV, RtoTR, and ZeRet.
    Attached Files
    Last edited by Robby Kurnia; 11 May 2021, 03:40.

  • #2
    Hi Robby,

    What regressions exactly are you running? Providing your code might help get an answer. I used your compiled file did a simple reg of RtoV on Volume and it worked fine. (also, you are asked to provide an extract of your data rather than uploading files, see FAQ for more details)

    Best,
    Rhys

    Comment


    • #3
      Hello and thank you, Rhys!

      I've done regression buy using both 'reg' and 'mvreg' of the third model on all the dependent variables. As an example of my 'reg' command I wrote 'reg RS AbsSkew Kurt Price Size StdDev Vol' and as an example for the 'mvreg' I wrote 'mvreg RtoV = AbsSkew Kurt Price Size StdDev Vol'. Both the reg and mvreg seems to consistently produce the same results and omit the variable Vol.

      As for the files I provided, I'm really sorry about that. I only use excel files because as of now they are the type I'm able to understand and use. And as for the file 'ACES Daily', I assumed it'd help finding the cause of the problem. Again, I'm really sorry about this.

      Best regards,
      Robby

      Comment


      • #4
        Hi Robby,

        No worries, I think the problem with uploading excel files is that not all users can open such files, so it might limit the number of people who can respond.

        If you have the data loaded in Stata then you can type dataex and paste the results here, so that we can see if something is going from Excel to Stata.

        I've never used mvreg but I don't see why Vol would be excluded from your OLS regression. Have you tried running something simple, like "reg RS Vol". Does that work? Perhaps then try adding the other vars gradually to see if the issue is caused by a var in particular.

        Best,
        Rhys

        Comment


        • #5
          Hi Rhys,

          I see, thanks for the reminder!

          Here's the result I got from 'dataex':

          Code:
          * Example generated by -dataex-. To install: ssc install dataex
          clear
          input byte ACES int Month double(StdDev AbsSkew Kurt ZeRet RS RtoV RtoTR Price Size Vol)
          . 20089  .02403673938908001   .05562969578656318  1.4941863480133106  .14285714285714285  .006688952790352419   5.45931852820861e-10  7.238937759742825e-13  6.618503708389359 23.638702974309417  17.02019929041668
          . 20120 .014024839239879471     .950657400239555   .6829986202643252  .21052631578947367  .006469182260304168  7.713612620126002e-10 1.0108374702651203e-12  6.650037544308885 23.079423793717332 16.429386263947716
          . 20148  .01810691705569959     .574146479769148   .5508162269930601  .18181818181818182  .006507574109018449 1.3843266120762592e-09 1.8105537768256512e-12 6.6446624670374765 22.818705276764724 16.174042850309377
          . 20179 .012514988731207991 .0008446032772600753  -.7724508009349194   .2857142857142857  .007250622611955652  5.656381281505949e-10  8.090484402770127e-13  6.535818102039492 23.238869083511513  16.70305100377217
          . 20209 .017179754890337504   .17595324017269914 -.36394141588437545  .15789473684210525  .008494912710980684  1.913242848514009e-09 2.8181784037646705e-12  6.526096186259823 22.455313785675738 15.929217652548976
          . 20240   .0211004665650133    .8717003402253192  2.3096795036164686  .19047619047619047  .008481613518989347 1.6308038795876504e-09 2.5256435447238726e-12  6.472264138515201 22.547396440461675 16.075132352417878
          . 20270  .03167236168442567   1.7626654092239062  3.8912499271448864   .2631578947368421   .01259153284458298 3.3489759202388742e-09  5.159059300297258e-12  6.465538358153687 21.890319347646617 15.424781099454668
          . 20301   .0354928952176068    .8525393268821826   2.666198975737566                  .1  .018170213414459967  4.441167112217555e-09  7.619442672597687e-12  6.404657456805422 21.795874249681397  15.39121687437993
          . 20332  .02144595906623877   .18947168963075034 -.34801806952632663  .19047619047619047  .012043072696067633  2.184793360645411e-09  4.072634679365352e-12  6.280780239323281 22.200855350979367 15.920075189378158
          . 20362  .04259236068605307   1.0416649648248495   .6257972421153868 .047619047619047616   .00928088891902519 2.3878231836590196e-09  3.744665550396589e-12  6.453722384508851  22.83839586078987 16.384673488752245
          . 20393  .03807054603773078     1.12570751398945   2.415678449195422  .14285714285714285  .009867083090158003 2.7546677855444944e-09  3.744889533935367e-12  6.607838565598015 22.461570201647397 15.853731699944664
          . 20423  .02733864976160597   .11006852277797988  -.8096327654336974  .10526315789473684 .0075729600567688675  3.655125702594169e-09  4.613171049659325e-12  6.676902889074847  22.43256388967607 15.755661123200426
          . 20454  .02465177288691045   1.2627271459489924  1.8461552936785672                 .15  .007920844956244726  3.970674315498935e-09  5.043963176276981e-12  6.664904940803494 22.035800670524786 15.370895818106144
          . 20485 .027456084909135765 .0007833771122501503  -.6342781690749493                 .15  .009015028789867177  5.615181434444295e-09  6.723797970061988e-12 6.7508256865899074 22.252884940392637 15.502059333580988
          . 20514 .033080853116887125   .22156846475089392 -.39225651573526443 .047619047619047616  .007126570090014298 3.0440674977314777e-09 3.4337672404628045e-12  6.776282027866491 22.905736246296243  16.12945425009559
          . 20545  .01818509685980921  .050404319791595945 -1.0614861871023882                   0  .006136312624698499  3.168473245115662e-09  3.730347429604234e-12  6.749667994435206 22.243153361381808  15.49348541250321
          . 20575 .028688624593952508    .8174562942847243   .7081491567439602                  .1  .007655402490358093 5.3959425872895666e-09  6.089517037124177e-12  6.786939942945961  21.98945617355391 15.202516309311616
          . 20606 .028101214495936184    .9688217994049172  1.1017960289921422  .18181818181818182  .008826120318174016  7.354163072560971e-09  8.166726244673231e-12   6.80084217128525 21.722018258466218 14.921176198733873
          . 20636  .02304388146922666    .3779028033353313   .4492710744696331               .1875  .007452662220470896  2.607870765217102e-09 2.7018328388117966e-12  6.874560753559202  22.28818020610543 15.413619501274814
          . 20667 .017462088654466672    .0553935553363316  .43224847433768687  .18181818181818182  .006527599111198731  2.985610534741674e-09 3.0455450356614776e-12  6.879677218062202 22.425272753861265 15.545595649491315
          . 20698  .01760801713570647    .3139780269010746  -.9835865256139269  .09523809523809523  .007686780716213406 6.1202830590199286e-09  6.519955409117864e-12  6.833105580895461 21.774348150187176 14.941242696219868
          . 20728  .01666533867089534   .27737856918373344  .05215760712926665  .19047619047619047  .007748892879128231 3.8878931425657156e-09  4.545524588480185e-12    6.7564333519013  21.89694392312083 15.140510693645384
          . 20759 .029606078729170874    1.456600750785142  2.7517863051358367   .2727272727272727  .008266350097358223  1.198601758509695e-08 1.4259162920227927e-11  6.744542838669738 21.552940300692878 14.808397751255988
          . 20789 .029663808038111562   1.0016323159144593   .4507409953635917                 .05  .011493441218962924 1.4401551378917474e-08 1.7200816024956687e-11  6.722536138069003 21.201320964099494 14.478785150590477
          . 20820 .013790980513793774   1.4564053795619283   4.052728690431461  .23809523809523808   .00721464696044115  1.885495231311402e-09  2.468605617013218e-12  6.631601899099873  22.26801529419742 15.636413485980459
          . 20851 .014617376230592212   .14292729995546966 -.24592151790485461   .2631578947368421  .007146425917241578  3.575617681520801e-09 4.6346263923754824e-12 6.6517311125997916 21.850619823432368 15.198888855328466
          . 20879  .02296056822726811   1.2956105699040061   2.021569313464873  .13636363636363635  .007665884744257928  3.508349459541363e-09  4.421779732966187e-12  6.679297900884532   22.0682065972939 15.388908761018717
          . 20910 .020800241633741008   .24097576625893488  -.6885889312496394  .23529411764705882  .006157033014606864 2.0181106516165198e-09 2.2687647717565037e-12 6.8175934249636345 22.878113099261157 16.060519727803786
          . 20940 .025760632582060936    .5865695252345531  1.0539208431655833                 .25  .008091872204580613 1.5574951641520302e-09 1.5999339355035421e-12 6.8813792001511045  23.25067285779582 16.369293675008528
          . 20971 .026145344044099003    .1550472390830648   -.745569585060835                   0   .00553130033778841  2.028472358934362e-09 1.9980059140048568e-12  6.933616093691474 23.445593296256433  16.51197724137124
          . 21001  .02692628491983128   1.0350233984069666   .7584996485590163                   0  .005216640173033947  2.208137068832714e-09  2.000737114450093e-12  7.008695929935696 23.108827942194473 16.100132057738932
          . 21032 .017937258841167373   .11318274597776605  -1.126326052941133  .13636363636363635   .00589646554591706  2.323340928414784e-09  2.149412536397728e-12  6.981847220335103 22.859668355197776 15.877821160888395
          . 21063 .021804012665005094    .6329580597380021   .9944996277529743  .05263157894736842  .005237757481845669  1.730538000825248e-09 1.5825751564162121e-12  7.013737749825539 23.198024905318523 16.184287173848855
          . 21093 .028730607935400283    2.068971251264785   5.726627963181704  .13636363636363635  .005070728453964352 1.3060234141098172e-09  1.011504052706329e-12  7.169148406039354 23.425952021644544  16.25680364273742
          . 21124 .023505311727172875     .171688226488768  -.7106497698467771  .22727272727272727  .004713321152729247 1.6897858810221269e-09 1.3956105779449662e-12  7.093777909619288 23.249073494010613 16.155295612975387
          . 21154 .025630894245142078    .9367531263998719   1.297662243724539   .1111111111111111  .004556822644422301  2.168822506129142e-09 1.8666850698985966e-12  7.056737624531289  22.95069774124187 15.893960146475232
          . 21185 .024581742529489057    .2146261272052659 .011908222685420355  .09090909090909091 .0064425870794360416  2.491395821908057e-09 1.9625772920868316e-12  7.145135076839835 23.113906611689405 15.968771553122634
          . 21216  .02114714529963048    .3197108846321549  -.5344346325087628  .05263157894736842  .005735699404473737 2.8018027755869827e-09 2.1175317843936577e-12  7.195104726705287 22.896996870261347 15.701892182250106
          . 21244 .016274417045992202    .6635192229109053  .12072052982951931   .2857142857142857  .005916171678612155 1.6193490944127016e-09 1.2183259737096047e-12  7.192203684561183  22.95032684912404 15.758123190271842
          . 21275 .025550348853876782   .38573950762756654  -.9102423731724318 .047619047619047616   .00627935252579703  4.025645520194619e-09 3.0024548897619347e-12  7.192708128370514  22.75786144269701 15.565153350614041
          . 21305  .03556771824333833   .22969978266721858   .9531441327780912                 .05  .010220411100274846  4.547279117908143e-09   3.68272009496383e-12  7.121036599824632  22.71027645150354 15.589239904780177
          . 21336  .02622835442880841   .20730258914004004 -.22377713140416322  .07692307692307693  .007765431097100099 3.1195679421525962e-09 2.4348067579244976e-12  7.157537723319961  22.70271349598524 15.545175779696093
          . 21366  .01717783321325488   1.0468918661993312  1.5045991890216808  .13636363636363635   .00874796254131395  5.555414416249824e-09  4.237703383045758e-12  7.171862623121425 22.228333480999858 15.056470950747542
          . 21397 .024967291753622358    1.085435431838333  1.0984937887985184 .047619047619047616  .005198033955677049 1.4682426623047826e-09  1.065642344377137e-12  7.222949304539921  23.46877756619539  16.24582828176963
          . 21428  .03235774460372921     .852345396417436   1.990232270483551  .05263157894736842  .007156837505305826  2.020137081175819e-09  1.457580725690706e-12 7.2227872260012855 23.296850759869006 16.074063557867277
          . 21458  .01444142488157701   .04434867435876988   .7994400850268999  .17391304347826086   .00427254046757419  8.535772753529592e-10  6.222445605356832e-13 7.2268510815220095 23.479196109080537  16.25234505054989
          . 21489 .020728757337377984   1.5175302726491002  2.5325404936914193 .047619047619047616 .0041137931883543305 1.5044286479974267e-09 1.0313194236568652e-12   7.27387469566293 23.275561569227857 16.001686907670052
          . 21519 .026597982887131444   .26007976022011325    .733160883734302  .16666666666666666 .0034978066778967674 2.0349638724215992e-09 1.3514037593765113e-12  7.320609992923532   23.2633288517303 15.942718888978725
          . 21550 .023988580437337613    .3350288125374887  .18673591629971176  .18181818181818182  .003354492930290927 1.3972717836267307e-09  8.412551940399235e-13  7.438577334582507 23.726025421523413 16.287448101557356
          . 21581  .02004190517903146   .29978478353048166  -.7704576123701781                   0 .0034086093943392157 1.9318386174711305e-09  1.082110311167325e-12  7.481472614883398 23.573148807439757 16.091676206094867
          . 21609  .01806794799383725     .806990636067302   .6855466191073316                  .2  .002923215380127814 1.8398242072890025e-09 1.0287493375552222e-12  7.493346551563633 23.407810706924288 15.914464170297515
          . 21640 .032183313859245256    .6950886960351025 .017717999671894358                   0  .003837951482307478 1.2103801402875353e-09  7.108462126091845e-13  7.430744811999613 24.339393786010813  16.90864898158813
          . 21670  .01860413781988148   .46526358080020397  1.3948673181915394  .14285714285714285 .0040404724557737874  1.248030006399127e-09  7.465671719933829e-13  7.407673449604664 23.563219127815326  16.15554570597241
          . 21701 .016602940782655798    .2700027263648143   -.600499680176338  .13333333333333333    .0031653572160031 1.2590324738796444e-09  7.105876540865555e-13  7.488704006277973 23.846773048732352 16.358069058383563
          . 21731 .020610398754431557   .37276653543814386  -.9863106320303601  .13043478260869565  .004428134702509129 2.2341000387613224e-09 1.2235184339533619e-12   7.50011127491869 23.332349278159967  15.83223803004561
          . 21762 .014759345657288623    .6213142975361833  1.0385412842151647  .09090909090909091 .0036408773748285396 1.0900991841967298e-09  6.263310518330916e-13  7.465517789121895 23.606656638336286  16.14113886862935
          . 21793 .015412363734855647   .17561156702550426   .5876483952939307  .23809523809523808 .0037987590313197225 1.0017804636505404e-09  5.709182132644752e-13  7.470822712584366 23.682149431961868 16.211326732500364
          . 21823 .018090694710626066    .4401832367344593  -.6292976912358572 .043478260869565216  .004377304786489072 1.0437381879718083e-09  5.869545727746968e-13  7.489759347838297 23.923570815864146 16.433811482326252
          . 21854 .022140990409794944    .2304703360596624  -.9515445938327973 .047619047619047616   .00340556017444572  5.719963426294789e-10 3.4169025693460144e-13   7.43255997346567 24.816681743338552 17.384121772620066
          . 21884  .02432413454603495     .509029427618854 -.04282020007817389   .2631578947368421 .0035578910766589753  7.493696748399635e-10  4.814478446837315e-13  7.347240277129979 24.374451867686908 17.027211600122858
          end
          format %tdMon-YY Month
          I've tried running simple regression and found that the problem (Vol being omitted) seems to appear if I include independent variables Size, Price, and Vol simultaneously like "reg RS Vol Size Price", same results with 'mvreg'. For these 3 variables, their formula are as follows:
          1. Size is the natural logarithm of Close multiplied by Volume Beredar
          2. Price is the natural logarithm of Close
          3. Vol is the natural logarithm of Volume Trade. Volume Trade is the result of Turnover - IDR divided by VWAP

          I had thought Size and Price might encounter collinearity due to them using Close. Instead, the problem seems to lie within Volume.

          Best regards,
          Robby

          Comment


          • #6
            Hi Robby,

            Great, am glad you've spotted the pattern although am also a little surprised that volume is collinear with size and price (but I have never been good at spotting perfect multicollinearity). Perhaps it's worth double checking the calculations for obtaining Vol, Size and Price to ensure they are correct. Otherwise you will probably need to exclude either size, price or vol in your regressions (or calculate size and price in a different way, if possible).

            Best,
            Rhys

            Comment


            • #7
              Hi Rhys,

              I see, I think I'll first recheck the calculations and formula for them then try to do find a way to calculate them in a different way. Thanks a lot!

              Best Regards,
              Robby

              Comment


              • #8
                I think you've explained your own problem. If I understand correctly and

                size = log (Close x Volume) = log Close + log Volume

                price = log Close

                vol = log Volume

                then you have only two predictors on the right-hand side and thus no more than two usable predictors on the left-hand side.

                As for Excel files, there is no need for uncertainty or speculation. We give 5 specific reasons at https://www.statalist.org/forums/help#stata why they are not as helpful as you hope, in fact for many people here, unfortunately not helpful at all.

                mvreg with one outcome or response variable is just another way to do a regression.

                Comment


                • #9
                  Hi Nick,

                  I see, thanks a lot for your explanation and pointing that out! I'll try to find a better approach and/or solution that'd help me solve the problem without going too far off what's intended.

                  In the future, hopefully I'd understand Stata better so I can provide better information without attaching type of files that are asked not to be attached.

                  Best regards,
                  Robby

                  Comment

                  Working...
                  X