Announcement

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

  • Conformabilty error for xtvar command in first difference

    Hi everyone! I am working with a panel dataset (10 countries) which runs from 2001q4 until 2021q4 (81 observations). Additionally to an analysis for each country separately, I want to do a panel analysis for the EU countries in my data. My unitroot tests showed that each variable is stationary in first difference.

    First I have to set:
    Code:
    set matsize 1000
    Then I try to run my PVAR in first difference:
    Code:
    xtvar DlgEHB DlgGDP DlgPCE DlgGGD DlgEMC DNEX if countryid<10, lags(2) step(8) ssaving(PVAR_Original_1, replace)
    Then I receive 'conformability error'. I do not know why this happens as my data is aligned and the code does work when I do not use the first difference values. However, when I do use the first difference values as shown above - to make them stationary - Stata gives me this error message.

    Does anyone know why I receive this error message when my variables are in first difference and how I can solve this?

    I am using Stata14 on Windows10. An example of my data is the below, where EHB stands for equity home bias, GDP for gross domestic product, PCE for private consumption expenditure, GGD for general government debt, EMC for equity market capitalisation, and NEX for net exports.
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input long countryid float(time DlgEHB DlgGDP DlgPCE DlgGGD DlgEMC DNEX)
    1 167            .            .             .            .            .           .
    1 168    .01344037   .012470245    .011489868     .0561409     .0797882  1107710464
    1 169    .01135002   .006456375    .009996414    .13183403   .073890686  -612017792
    1 170   .009702563   .004665375    .015312195   -.00676918   .068805695   619649728
    1 171  .0083794445   .007722855    .008773804    .02045822    .06437302   -73461704
    1 172   -.02245453    .00248909   .0012779236     .0848217    .15771103  -527276704
    1 173  -.017084777   .003606796    .006669998    .07517815    .13619423   210073200
    1 174   -.01343891   .005226135   .0018463135  -.009002686    .11984825   117352000
    1 175  -.010849386   .018512726    .009578705    .04410172    .10700989   311017984
    1 176   -.04031658   .005897522     .01819992   .017076492    .12948036   477147296
    1 177  -.032792836    .01823616    .010183334    .04331207     .1146202   352616992
    1 178   -.02721441   .013832092     .02416992    .03268051    .10282326  -592561728
    1 179   -.02295962   .007303238    -.00276947   .016572952     .0932293 -1246427392
    1 180   .013520122    .01630783     .01912689    .08058548    .10398483  2564815360
    1 181     .0109182   .010770798      .0165596  -.025432587    .09418297 -1724398208
    1 182   .008996129   .010038376  -.0028591156 -.0022640228    .08607101   210347344
    1 183   .007536352    .01897812    .017932892   -.09778595    .07924461   598533824
    1 184  -.015555978   .006101608    .006643295    .08021927    .12373924    88957896
    1 185   -.01251927    .02032852    .013702393    .09467888    .11009789   243291504
    1 186  -.010297388   .010356903    .004459381  -.031288147    .09917068   262398304
    1 187  -.008621901   .019094467     .00531578 -.0004310608     .0902176   958534272
    1 188   .012488365   .014360428    .015657425    .08208656    .05509758  -458994912
    1 189   .011085898   .008264542    .004213333    .05939293     .0522213  1260903936
    1 190   .009907693   .016708374    .018945694    .08880615    .04962921  -452235008
    1 191   .008908242   .010763168    .013336182    -.0948124    .04728127   447729984
    1 192  -.012715071    .01181221    .002122879    .10624504   -.18553352  2043981952
    1 193   -.01961416 -.0009918213   -.004026413     .0062294   -.22797966 -2667448576
    1 194  -.034175277  -.018383026   -.010305405   -.08584023   -.29579735   977169792
    1 195   -.07435912  -.013620377    .005069733   .005933762    -.4218941 -2353598208
    1 196   .018521428  -.002893448    .017715454  .0006752014    .11674309   487185664
    1 197   .014600903   .009283066    .006195068    .07938766    .10452652  -520353984
    1 198   .011807203   .009250641   -.004125595   .018354416    .09462929   519489888
    1 199   .009745985 -.0045337677    .007902145    .06693268    .08644104   383098080
    1 200   .003921747   .013462067   .0014209747   -.05528831   .025865555  -685691264
    1 201  .0037116706   .011774063     .02425766   -.05299759   .025211334  -710966784
    1 202  .0035181046    .01594925    .007171631    .11524773   .024591446   104686496
    1 203  .0033392906   .017328262    .005346298   -.02031517   .024002075   479807296
    1 204  -.006310016   .007392883    .016691208    .07366943   -.08431435 -1027634432
    1 205  -.007603884   .008407593     .01128006   .027793884   -.09208298   723459008
    1 206   -.00933534 -.0010414124    .014356613   -.06171417   -.10142899 -1443529984
    1 207   -.01172608    .01948738    .009378433  -.027996063   -.11289215  1734207872
    1 208  -.005142212  .0002193451  -.0020713806    .12741661    .05910492 -1343006848
    1 209 -.0046091676  .0026454926  -.0002593994   -.04248428    .05580711   469035008
    1 210 -.0041550994   .004547119    .003681183    .01140213    .05285645   499337088
    1 211  -.003765106 -.0006504059    .009679794    .02390671    .05020142  -197554096
    1 212    .06005242   .006944656    .004211426    -.0194397   .027059555  1438714496
    1 213    .05377954   .009910583    .005159378    .02104187   .026348114 -1151344896
    1 214   -.08001778   .005865097    .008861542    .05371666    .02567291  -243619504
    1 215   -.08250064  .0015773773    .008853912  .0046100616    .02502823  -130935200
    1 216   -.01999825    .01460266     .00151062   .005670547   -.04537582  -336516800
    1 217  -.022437155   .007621765    .007307053   .011180878   -.04753494  1647413120
    1 218   -.02144724   .007211685   -.003095627   -.09469223   -.04990768  -135634496
    1 219  -.024333775   .003211975    .008260727    .01051712   -.05253029   901588288
    1 220   .027309775   .010845184    .007141113   -.10079575 -.0018367767  -459499008
    1 221    .02667892   .012849808   .0042152405    .05773354 -.0018424988  -247666304
    1 222   -.02306348   .006149292    .006940842   .012414932  -.001844406  -777226880
    1 223   -.02369815   .017105103    .002416611   -.03088379 -.0018482208  -471945472
    1 224    .09161073   .005882263     .01889229    .06223679    .06277084  2036384640
    1 225    .07463017    .00305748  -.0013256073  -.025691986    .05906296 -1259828480
    1 226    -.0193806   .004796982    .019563675  -.015195847    .05576897   625023488
    1 227  -.017722249   .008071899    .007274628   -.03943825    .05282021 -1614850816
    1 228   -.07930958    .01458931    .007335663   -.00519371    .05950546  -503466496
    1 229   -.07636696   .010364532     .01161003    .07333374    .05616379  1510434176
    1 230   .011477292   .007873535  -.0003910065    .03012657    .05317497  -116937200
    1 231    .01023525   .016942978    .021663666   .012638092    .05049133   684394816
    1 232    -.0522117  .0012130737   -.003519058    .02484131   -.05780411   309451200
    1 233   -.06228644    .01000023    .001832962   -.05223656   -.06135178  -686935424
    1 234    .04240453   .016906738    .014663696  -.006843567   -.06536293  -601774528
    1 235    .04643118   .004976273    .010894775  -.022317886  -.069934845  -960337088
    1 236    .01177913  .0009746552  -.0010356903  -.026851654     .0342865  2220855296
    1 237   .010886908   .012960434    .001274109    .00946617   .033147812 -1050337024
    1 238   -.02704829 -.0006580353    .003406525   -.04322052    .03208542   232352992
    1 239   -.02607602   -.02063751   -.012374878    .02760887   .031087875  1171462016
    1 240     .0957225   -.10443687    -.14143944   .005771637 -.0019073486  -637937024
    1 241    .08766311     .1057701     .11207008     .1043148 -.0019130707 -1253708032
    1 242   -.12135732  -.015472412    -.03805733   .003004074  -.001914978   952243008
    1 243   -.13872707  -.003873825   -.012218475    .09955597 -.0019187927 -1207874048
    1 244   .062705755    .04421043     .05618668  -.007871628    .10041046 -2413560064
    1 245    .04895127    .04821777     .08449173    .03566742    .09124184   546722368
    1 246    .03648448    -.0113945   -.034778595  -.032157898    .08360863   776444992
    1 247   .030044377   .032304764     .05870438   -.01828003    .07715416 -1078011392
    2 167            .            .             .            .            .           .
    2 168  -.012675822   .011026382    .005542755    .02059555   -.05944633    92365296
    2 169   -.01453486   .009569168    .006929398    .12802505   -.06320572   295809312
    2 170  -.016836286    .00851059   .0042915344  -.015836716   -.06747246   190596800
    2 171   -.01973331  .0010242462    .007383347    .04902267   -.07235718  -163644096
    2 172  -.005549729   .008758545 -.00013923645    .06722641    .08631516 -1768024064
    2 173  -.004726231   .008131027    .008134842     .0447216     .0794506  2340798208
    2 174  -.004073411   .012289047    .010213852    .01499939    .07360268  -450396704
    2 175  -.003547102   .020751953    .010383606    .07232094   .068553925  1013980224
    2 176  -.006272852   .010549545     .01030159   .009796143     .1341877  -8.955e+08
    2 177  -.005007923   .014930725    .006168365  -.006767273    .11829567  -602312320
    2 178  -.004106611   .009662628    .009447098    .02269554     .1057682   963360704
    2 179 -.0034395456    .00787735    .007598877    .05420876      .095644   809953920
    2 180   -.00528866   .012029648    .013835907  .0006771088    .01384163 -1178322048
    2 181   -.00517559   .010335922     .01836586   -.07780457   .013652802  -455604992
    2 182  -.005066067   .016744614    .010557175  -.007455826    .01346779  -633816320
    2 183  -.004959941   .011384964    .007677078   -.03744125   .013290405  -101226200
    2 184  -.009614348   .005743027    .012691498    .06921196    .08922005  -465000992
    2 185  -.008192122   .014247894     .00979805   .032117844    .08190918   106613000
    end
    format %tq time
    label values countryid countryid
    label def countryid 1 "Austria", modify
    label def countryid 2 "Belgium", modify

  • #2
    Willem:
    the following thread might be useful: https://www.statalist.org/forums/for...hetic-controls
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo - thank you for your response! I saw that thread but unfortunately did not work for me. After some more hours I found that I had to drop my first line of observation (2001q4) to make the dataset balanced then it worked for me.

      Comment

      Working...
      X