Announcement

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

  • Confusion with type of regression to employ and code

    My basic purpose is to investigate the determinants of price distortion in pump schemes in the crypto market. The data is taken for only pump events therefore no any regularity in the cross sections and timpe period. I am perplex about this data arrangement whether this be treated as pseudo-panel or cross-sectional. I have to run the following the simple OLS assuming it a cross sectional data but i am not sure if i am doing it right. In my case price increase is dependent variable while Marketcap, volatility, liquidity and BTC price are independent variables. The data sample is shown below. I want to know what exactly regression model would be best for this issue. I have done this through OLS but I am not sure whether I am doing in correct. Any help in this regard would be highly appreciated.
    ----------------------- copy starting from the next line -----------------------
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str5 symbol int date double(pricebeforepump priceincrease marketcap) float(priceincrease_percent volatility log_marketcap log_priceincrease_percent liquidity) double BitcoinPrice
    "ADX"   22103 .00001108   .26353790613718403            8830000  26.35379  .14428686 15.993666   3.271612    1.5831964  9259.06
    "ADX"   21756 .00001156                    0            8830000         0 .019000005 15.993666          .    .06604802    11280
    "ADX"   21735 .00001279   .15559030492572332            8830000  15.55903  .11373606 15.993666   2.744641     .9631777  9804.76
    "AMB"   21550  .0000197 .0005076142131978787           10960000 .05076142  .04687833 16.209763  -2.980619    .15133357  3682.61
    "APPC"  22223 2.480e-06   .21370967741935484            8750000  21.37097  .23067573 15.984564  3.0620334     8.339266 14068.97
    "APPC"  22237 1.290e-06   .19379844961240322            5670000 19.379845  .11105718   15.5507  2.9642336    1.7803843 14068.97
    "APPC"  22246 1.350e-06    .2666666666666666            5540000 26.666666  .14196593 15.527505  3.2834144     1.889204 19188.36
    "APPC"  22256 1.480e-06   .09459459459459454            7000000  9.459459  .05428116  15.76142  2.2470152     .6181653 14068.97
    "APPC"  22293 8.300e-07    .4216867469879517            7360000  42.16867  .22595243  15.81157  3.7416775    1.9865842 37299.49
    "ARDR"  21656 .00001618   .10321384425216311           80750000 10.321384  .09651504  18.20687  2.3342178     .1530327  5203.41
    "ARDR"  22221 3.750e-06    .6079999999999999            3600000      60.8  .29008508 15.096444  4.1075897     6.730122 13517.14
    "ARDR"  21700 .00001027  .026290165530671938           88500000 2.6290166  .04005225 18.298513   .9666099   .021697355  5203.41
    "AST"   21610 .00001223    .0825838103025348            6400000  8.258381  .09781606 15.671808  2.1112285     9.922818  3813.09
    "AST"   21434 .00001339  .035847647498132844           12240000  3.584765  .02339858 16.320219   1.276693   .033481047  6438.79
    "AST"   22044 1.530e-06   .14379084967320263            2200000 14.379085  .08068423 14.603968  2.6657746     3.829723  9758.84
    "AST"   21356 .00002688                    0           27690000         0 .010139147 17.136581          .  .0044215242  6713.96
    "BCD"   21353   .002163   .03791030975496997          364710000  3.791031  .02318004 19.714613   1.332638 5.477788e-06     8737
    "BCD"   21864 .00005936  .024090296495956842           95990000   2.40903  .02573579 18.379755   .8792241   .004839452  6460.57
    "BLZ"   21652 .00001382   .17945007235890015           14350000 17.945007   .0991216 16.479261   2.887312     .9736063   9564.2
    "BLZ"   21758 4.040e-06   .18316831683168308            7970000 18.316832  .10548816 15.891195  2.9078205     1.880929 10252.46
    "BLZ"   21696 7.440e-06   .10215053763440854           13500000 10.215054  .06490518   16.4182  2.3238626     .1845574     8633
    "BLZ"   21809 3.490e-06  .008595988538681987            7030000  .8595989  .05536577 15.765697  -.1512894    .36022815  5067.76
    "BLZ"   21818 3.250e-06  .018461538461538547            5510000  1.846154  .04716404 15.522076   .6131045    .25755626  5067.76
    "BLZ"   21724 7.640e-06  .007853403141361404           16110000  .7853403  .08804436 16.594952 -.24163814    1.2594963  5067.76
    "BNT"   21555 .00017463    .3170703773692951           43740000 31.707037  .17329314 17.593773   3.456539    .02405144  3967.49
    "BNT"   21991 .00002865 .0013961605584643284           10140000 .13961606 .020222826 16.131998  -1.968859    .02614783  3967.49
    "BNT"   22029 .00003073                    0           14710000         0   .0507474 16.504038          .    .06085683    11485
    "BNT"   21204 .00061364    .7935923342676488          236520000  79.35923  .36173335 19.281544   4.373985  .0044788853  7514.92
    "BNT"   21211 .00065471    .4183378900581938          220660000  41.83379    .242079 19.212133   3.733704   .002804423  7514.92
    "BNT"   21801 .00003683    .3999456964431171           23500000  39.99457   .2205954 16.972511  3.6887436    .05711243 10230.91
    "BRD"   21540   .000053   .07452830188679248           18340000   7.45283  .04339607 16.724594  2.0085938    .01989493  3787.24
    "BRD"   21694 .00005926   .02092473844076952           42660000 2.0924737  .01477235 17.568771    .738347  .0019409517  6485.99
    "BRD"   21461 .00006845    .1117604090577065           33750000  11.17604  .15284933 17.334492   2.413772    .05374868  8668.51
    "BRD"   21501 .00005575    .1386547085201793           31010000  13.86547   .0791675  17.24982   2.629402    .06463528  8668.51
    "BRD"   21548 .00005957   .03709921101225439           19830000  3.709921  .07309789 16.802706  1.3110106    .09305537  6485.99
    "BRD"   21625 .00006656  .049729567307692214           23620000  4.972957  .05045333 16.977604  1.6040145    .04645915  3837.26
    "BRD"   21717 .00005062  .008099565389174196           40090000  .8099566 .033891145 17.506638 -.21077468   .005323722  6611.09
    "BRD"   21934 .00002845   .18594024604569415           21840000 18.594025  .10241725 16.899254    2.92284    .09896163 15111.62
    "BRD"   21998 .00002381   .11003779924401506           12300000  11.00378  .08322026  16.32511   2.398239     .3199572  9158.42
    "BRD"   22228 5.100e-06    .4686274509803921            6690000  46.86274  .23791996 15.716125   3.847223    1.7924647 19105.21
    "BRD"   22255 4.740e-06   .08016877637130795            7510000  8.016877  .08019377 15.831746   2.081549     1.470113  3990.94
    "BRD"   21465 .00005692   .08520730850316238           32820000  8.520731  .04910851  17.30655   2.142502   .017471999  8005.51
    "BRD"   21825 .00002763   .00941006152732528           20040000  .9410061 .014162267  16.81324 -.06080563   .006336826  6659.03
    "BRD"   21653  .0000607 .0006589785831960398           27300000 .06589786 .006261597 17.122396  -2.719649  .0008514652  6611.09
    "BTS"   21749 4.340e-06   .08755760368663589            2450000   8.75576  .06299275 14.711598  2.1697118     1.532975    10410
    "CDT"   21682 1.100e-06                   .2            5510000        20   .1727707 15.522076   2.995732     3.312379 11743.37
    "CDT"   22174 7.000e-07   .15714285714285717            5090000 15.714286  .14147185 15.442788    2.75457     3.436248  7771.91
    "CDT"   21770 1.470e-06    .2108843537414966           11250000 21.088436  .11491796 16.235878   3.048725     5.932841 11059.57
    "CHAT"  21345 8.740e-06    .5446224256292906           34990000  54.46224   .2611117 17.370573  3.9975076    1.1963186  6689.11
    "CHAT"  21277 .00001183  .039729501267962854           45750000   3.97295   .0753309 17.638702   1.379509    .23280995   7405.8
    "CLOAK" 21458  .0003612     .462624584717608           12140000  46.26246  .22835287 16.312016   3.834331    .06776369  6326.92
    "CLOAK" 21366  .0006169    .4739828173123684           19890000  47.39828  .23309597 16.805727   3.858586   .018652383  6587.91
    "CND"   21739 9.900e-07   .17171717171717157           18450000 17.171717  .10126826 16.730576  2.8432636     .4855493 12508.83
    "CND"   21477 3.840e-06   .13020833333333343           35920000 13.020833  .07350988 17.396805   2.566551     .8484686   7900.8
    "CND"   21690 2.420e-06                    0           26450000         0 .007491505 17.090767          .   .022780756  6573.01
    "CTXC"  22069 .00001157   2.1106309420916163           26550000  211.0631   .6815322  17.09454   5.352157      .998849   9221.8
    "CTXC"  22106  .0000125   .18879999999999994           28660000     18.88  .10482536 17.171013   2.938103     .3311324  9561.03
    "CTXC"  22287 3.140e-06   .10191082802547767           24890000 10.191083   .2557813 17.029976  2.3215132     .6008168  9561.03
    "CVC"   21774 3.950e-06    .6455696202531643           14580000  64.55696   .3098698 16.495161   4.167548    2.1200967 10914.24
    "CVC"   22040 2.520e-06   .02777777777777785           14650000  2.777778  .04826381  16.49995  1.0216513     .2039239 10914.24
    "DATA"  21456 5.470e-06   1.5301645338208407           24150000 153.01645  .55749154 16.999794   5.030545     3.868892    10331
    "DATA"  21776 1.020e-06    .6666666666666667            6990000 66.666664    .306782  15.75999   4.199705     5.680794    10331
    "DATA"  21800 1.290e-06   .28682170542635665            8430000  28.68217  .17036363 15.947308   3.356276    4.4180536  6588.59
    "DGD"   21193   .014049    4.765534913516976          414180000  476.5535  1.0521219  19.84181    6.16658 .00012305587 14755.03
    "DLT"   22275 1.710e-06     5.16374269005848 4070000.0000000005 516.37427  1.1028608 15.219153   6.246832    34.258972 26702.19
    "DLT"   21419 6.760e-06   .11538461538461542            3700000 11.538462  .07183211 15.123843   2.445686    1.3338903     6454
    "DLT"   21254 .00002421    .9095415117719952           20000000  90.95415   .3884809 16.811243  4.5103555    1.2062558 15353.48
    "DLT"   21745 7.060e-06   .04249291784702545            5390000  4.249292  .08299796 15.500056  1.4467523    .57547736  8608.99
    "DLT"   21918 5.580e-06    .4193548387096775            3550000  41.93548    .210318 15.082458  3.7361324     9.933928  7341.06
    "DLT"   22002 5.170e-06   .24177949709864618            2880000  24.17795  .13004878   14.8733   3.185441    11.449346 10424.74
    "DLT"   22227 2.870e-06   .42857142857142844            3660000  42.85714  .23118326 15.112974   3.757872    15.855954   6233.1
    "DLT"   21341  .0000235   .04553191489361709           14630000 4.5531917  .03861269 16.498585  1.5158285    .07509577  9373.71
    "DLT"   21265 .00003214     .073428749222153           18880000  7.342875  .12216134 16.753614  1.9937304     .5588165  7629.99
    "DLT"   21314 .00003197  .003127932436659444           24230000 .31279325  .03947137 17.003101 -1.1622128    .03026847     9585
    "DNT"   21972 7.100e-07    .1830985915492958            4000000 18.309858  .10097651 15.201805    2.90744     21.58575  8739.58
    "DNT"   21978 7.500e-07   .17333333333333337            3920000 17.333334  .09599893 15.181602  2.8526316    12.913827  8931.23
    "DNT"   21267  .0000101   .06732673267326736           35930000  6.732673  .09192731 17.397083  1.9069723     .9821329  8892.56
    "DNT"   21726 1.260e-06   .12698412698412695            9900000 12.698413  .14791633 16.108046   2.541477    1.1107452 12014.17
    "DNT"   21729 1.450e-06   .06896551724137923            9390000  6.896552  .04005225 16.055157  1.9310216     .8975245 13538.38
    "DUSK"  22218 3.620e-06   .10497237569060766           12900000 10.497237  .07336914 16.372738  2.3511121      .351099 13518.25
    "DUSK"  22218 3.060e-06    .9117647058823529           11320000  91.17647   .3891797  16.24208   4.512797    3.1748965 13522.27
    "EDO"   21596  .0002107   .15045087802562893           22420000 15.045088   .1297527 16.925465  2.7110515    .02038006   8053.7
    "EDO"   21891 .00003488  .021215596330275317           11700000 2.1215596  .06248914 16.275099   .7521515    .03697436  3626.32
    "EDO"   22000 .00001955    .2511508951406649            7700000  25.11509   .2052232  15.85673   3.223469    1.5074798  6638.32
    "EDO"   21798  .0000282   .03900709219858155           15500000  3.900709  .08578317  16.55635  1.3611584   .011491317  8346.61
    "EDO"   21817 .00003425   .11007299270072991           15500000   11.0073 .067997634  16.55635  2.3985586   .016929483  7537.24
    "EDO"   21874 .00003376   .09004739336492884           13860000   9.00474 .064546086 16.444517   2.197751   .025557576  7537.24
    "EDO"   21922 .00002232  .014784946236559226            9590000 1.4784946 .011510997 16.076231   .3910244   .003901147  6326.01
    "EDO"   21899 .00003565   .13352033660589066           10240000 13.352034  .07779945 16.141811  2.5916686    .27769512  7099.71
    "EDO"   21470  .0001708   .07786885245901638           28770000  7.786885 .065417774 17.174843   2.052441   .012853335  7587.14
    "ELF"   22015 9.210e-06  .001085776330075994           30450000 .10857763  .02324186 17.231596   -2.22029    .04699547  6857.54
    "ELF"   22120 .00001198   .13522537562604336           52570000 13.522537  .08221587 17.777657   2.604358     .2830742  9557.44
    "EVX"   21463 .00007637    .8580594474270001            7120000  85.80595   .3780737 15.778419  4.4520884     .6430308 26591.29
    "EVX"   21495 .00008299  .031690565128328636            7590000 3.1690564  .05590136 15.842342  1.1534339    .12802899     6577
    "EVX"   21528 .00006717   .03945213637040361            3750000 3.9452136  .07884362 15.137266   1.372503     .2386768  4640.33
    "EVX"   21557 .00005974   .07666555071978563            4320000  7.666555   .0446644 15.278766  2.0368674    .14497708  3968.77
    "EVX"   22278 .00001193   .08968985750209556            5760000  8.968986  .12200546 15.566448  2.1937726    1.0078204  6066.77
    "EVX"   22289 .00001331   2.3531179564237417            9770000  235.3118   .9785259 16.094828   5.460911     1.886297  40718.8
    "EVX"   21508 .00006199   .20874334570091965            5170000 20.874334    .153707 15.458384    3.03852    .17771587 25619.24
    "EVX"   22090 .00002806   .02352102637205989            4660000 2.3521025  .06230039 15.354526   .8553096    1.2646012  6593.34
    end
    format %tdnn/dd/CCYY date
    ------------------ copy up to and including the previous line ------------------

    Listed 100 out of 308 observations
    Use the count() option to list more

    .



  • #2
    Zulfiqar:
    nothing sinister: you're simply dealing with an unbalanced panel.
    That said, you may want to elaborate on what follows:
    Code:
    . encode symbol, g(panel_id)
    
    . xtset panel_id date
    repeated time values within panel
    r(451);
    
    . xtset panel_id
    
    . xtreg pricebeforepump log_priceincrease_percent log_marketcap, vce(cluster panel_id)
    
    Random-effects GLS regression                   Number of obs     =         96
    Group variable: panel_id                        Number of groups  =         24
    
    R-squared:                                      Obs per group:
         Within  = 0.1482                                         min =          1
         Between = 0.4873                                         avg =        4.0
         Overall = 0.2092                                         max =         14
    
                                                    Wald chi2(2)      =       7.18
    corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0276
    
                                               (Std. err. adjusted for 24 clusters in panel_id)
    -------------------------------------------------------------------------------------------
                              |               Robust
              pricebeforepump | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
    --------------------------+----------------------------------------------------------------
    log_priceincrease_percent |   .0000171   7.33e-06     2.33   0.020     2.71e-06    .0000315
                log_marketcap |   .0001121   .0000505     2.22   0.026     .0000131    .0002112
                        _cons |  -.0012339   .0008954    -1.38   0.168    -.0029889    .0005211
    --------------------------+----------------------------------------------------------------
                      sigma_u |  .00203196
                      sigma_e |  .00018069
                          rho |  .99215461   (fraction of variance due to u_i)
    -------------------------------------------------------------------------------------------
    
    . xtoverid
    
    Test of overidentifying restrictions: fixed vs random effects
    Cross-section time-series model: xtreg re  robust cluster(panel_id)
    Sargan-Hansen statistic   3.676  Chi-sq(2)    P-value = 0.1591
    
    .
    In the example above -re- rules. Check it out with your full sample and all the necessary predictors plugged in the right-hand side of your regression equation.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Carlo Lazzaro Thank you so much

      Comment

      Working...
      X