Announcement

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

  • xtivreg re, weakiv and xtoverid

    Dear all,

    Currently, I am running into some trouble with xtivreg in combination with random effects. My regression is formulated as follows:
    Code:
    xtivreg ln_FDI (tt_d= comlang_off colony treaties_s ln_GDP_1) ln_Openness_1 ln_GDP_pc_1 ln_Telephone_1 PS_1 ln_Gov_exp_1 ln_GDP_Growth_1 ln_av_CPI_5 ln_M2_growth_1 i.Country_e i.cou_e i.year, re first

    I want to test whether my instruments are weak or overidentified. However, the commands
    Code:
    weakivtest
    and
    Code:
    xtoverid
    do not work in combination with re.


    With regards to weakiv I get the following error:
    error - unsupported xtivreg model g2sls
    r(198);

    Does anyone know how to circumvent this/knows of a different command that allows for testing weak iv for re models?


    With regards to xtoverid, I have already tried to circumvent the issue of xtoverid being unable to deal with factor variables by coding the following:

    Code:
    fvrevar i.Country_e i.cou_e i.year
    xi: xtivreg ln_FDI (tt_d= comlang_off colony treaties_s ln_GDP_1) ln_Openness_1 ln_GDP_pc_1 ln_Telephone_1 PS_1 ln_Gov_exp_1 ln_GDP_Growth_1 ln_av_CPI_5 ln_M2_growth_1 `r(varlist)', re first
    xtoverid, cluster(country_pair_c)
    However, I run into the problem that because of collinearity lot of dummies made by
    Code:
    xi:
    are dropped in the second stage. This leads Stata to give the following error after
    Code:
    xtoverid
    :
    o. operator not allowed
    r(101);

    Does anyone know how to solve this?



    I am using StataMP 17 (64-bit) on a Windows10 Enterprise OS.

    My data looks as follows;

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    
    input float(ln_FDI tt_d) double Openness_1 float(ln_GDP_pc_1 ln_Telephone_1) double PS_1 float(ln_Gov_exp_1 ln_GDP_Growth_1 ln_av_CPI_5 ln_M2_growth_1) double(Source WHTrates PE Other UN) byte(comlang_off colony) int treaties_s float ln_GDP_1
             0 0 . 6.931498    .317376 -2.671054 .  1.554339 2.1304839  2.970524 . . . . . 0 0 .  24.31324
             0 0 . 7.013929   .3144341 -2.571222 . 1.1674504 2.1967888 1.8431436 . . . . . 0 0 .  24.36789
             0 0 . 6.931498    .317376 -2.671054 .  1.554339 2.1304839  2.970524 . . . . . 0 0 .  24.31324
             0 0 . 6.940572   .3216475 -2.801084 . 1.7004848 1.7526053 2.1170902 . . . . . 0 0 .  24.34779
             0 0 . 7.152811  .28499976 -2.418561 . 3.2403915 3.0799816 2.8629184 . . . . . 0 0 .   24.4075
             0 0 . 7.129804  .29258543 -2.519349 .  2.423923  2.570989 2.9896774 . . . . . 0 0 .  24.41944
             0 0 . 7.113506    .300889 -2.411068 .  1.727542  2.480182  2.793149 . . . . . 0 0 . 24.436697
             0 0 . 7.013929   .3144341 -2.571222 . 1.1674504 2.1967888 1.8431436 . . . . . 0 0 .  24.36789
             0 0 . 6.931498    .317376 -2.671054 .  1.554339 2.1304839  2.970524 . . . . . 0 0 .  24.31324
             0 0 . 6.940572   .3216475 -2.801084 . 1.7004848 1.7526053 2.1170902 . . . . . 0 0 .  24.34779
             0 0 . 6.878675   .3373562 -2.763864 . 1.0090588 1.5797658 1.6744245 . . . . . 0 0 .  24.30974
             0 0 . 6.896047   .3469158 -2.655531 . 2.0730472 1.7911087  2.441974 . . . . . 0 0 .  24.35024
             0 0 .  6.04682          . -2.296179 . 1.1461606         .         . . . . . . 0 0 .  23.07021
       1.65107 0 . 6.182219          . -2.070934 .  3.113687         .         . . . . . . 0 0 . 23.242435
     -2.401703 0 .  6.26809          . -2.221302 . 2.3802252         .         . . . . . . 0 0 . 23.358213
     1.1734915 0 . 6.578401          . -2.410581 .  3.321026         . 4.4403205 . . . . . 0 0 .  23.69346
             0 0 . 6.592124          . -2.690477 .  2.076356         . 4.1396933 . . . . . 0 0 .  23.72987
             0 0 . 6.773696 .018065697 -2.712689 . 3.7566414   3.08054 4.1912484 . . . . . 0 0 .  23.93541
             0 0 . 6.990822  .05691534 -2.579152 . 3.3589735  3.109101  3.987368 . . . . . 0 0 . 24.180004
    -3.0489736 0 . 7.075285  .04483942  -2.50206 .  .4143925   3.10329  3.752835 . . . . . 0 0 .   24.2959
      .7900314 0 . 7.152811  .28499976 -2.418561 . 3.2403915 3.0799816 2.8629184 . . . . . 0 0 .   24.4075
     -2.735222 0 . 7.129804  .29258543 -2.519349 .  2.423923  2.570989 2.9896774 . . . . . 0 0 .  24.41944
      .0842044 0 . 7.113506    .300889 -2.411068 .  1.727542  2.480182  2.793149 . . . . . 0 0 . 24.436697
     .03095823 0 . 7.013929   .3144341 -2.571222 . 1.1674504 2.1967888 1.8431436 . . . . . 0 0 .  24.36789
     1.1697117 0 . 6.931498    .317376 -2.671054 .  1.554339 2.1304839  2.970524 . . . . . 0 0 .  24.31324
     -.9001914 0 . 6.940572   .3216475 -2.801084 . 1.7004848 1.7526053 2.1170902 . . . . . 0 0 .  24.34779
      .3031813 0 . 6.878675   .3373562 -2.763864 . 1.0090588 1.5797658 1.6744245 . . . . . 0 0 .  24.30974
     -.7834536 0 . 6.896047   .3469158 -2.655531 . 2.0730472 1.7911087  2.441974 . . . . . 0 0 .  24.35024
             0 0 . 7.129804  .29258543 -2.519349 .  2.423923  2.570989 2.9896774 . . . . . 0 0 .  24.41944
    -1.7108308 0 . 7.113506    .300889 -2.411068 .  1.727542  2.480182  2.793149 . . . . . 0 0 . 24.436697
    -2.3509212 0 . 7.013929   .3144341 -2.571222 . 1.1674504 2.1967888 1.8431436 . . . . . 0 0 .  24.36789
             0 0 . 6.931498    .317376 -2.671054 .  1.554339 2.1304839  2.970524 . . . . . 0 0 .  24.31324
             0 0 . 6.940572   .3216475 -2.801084 . 1.7004848 1.7526053 2.1170902 . . . . . 0 0 .  24.34779
             0 0 . 6.878675   .3373562 -2.763864 . 1.0090588 1.5797658 1.6744245 . . . . . 0 0 .  24.30974
             0 0 . 6.896047   .3469158 -2.655531 . 2.0730472 1.7911087  2.441974 . . . . . 0 0 .  24.35024
             0 0 . 6.931498    .317376 -2.671054 .  1.554339 2.1304839  2.970524 . . . . . 0 0 .  24.31324
             0 0 .  6.04682          . -2.296179 . 1.1461606         .         . . . . . . 0 0 .  23.07021
             0 0 . 6.182219          . -2.070934 .  3.113687         .         . . . . . . 0 0 . 23.242435
             0 0 .  6.26809          . -2.221302 . 2.3802252         .         . . . . . . 0 0 . 23.358213
             0 0 . 6.592124          . -2.690477 .  2.076356         . 4.1396933 . . . . . 0 0 .  23.72987
             0 0 . 6.773696 .018065697 -2.712689 . 3.7566414   3.08054 4.1912484 . . . . . 0 0 .  23.93541
             0 0 . 6.990822  .05691534 -2.579152 . 3.3589735  3.109101  3.987368 . . . . . 0 0 . 24.180004
             0 0 . 7.075285  .04483942  -2.50206 .  .4143925   3.10329  3.752835 . . . . . 0 0 .   24.2959
             0 0 . 7.152811  .28499976 -2.418561 . 3.2403915 3.0799816 2.8629184 . . . . . 0 0 .   24.4075
             0 0 . 7.129804  .29258543 -2.519349 .  2.423923  2.570989 2.9896774 . . . . . 0 0 .  24.41944
             0 0 . 7.113506    .300889 -2.411068 .  1.727542  2.480182  2.793149 . . . . . 0 0 . 24.436697
             0 0 . 7.013929   .3144341 -2.571222 . 1.1674504 2.1967888 1.8431436 . . . . . 0 0 .  24.36789
             0 0 . 6.931498    .317376 -2.671054 .  1.554339 2.1304839  2.970524 . . . . . 0 0 .  24.31324
             0 0 . 6.940572   .3216475 -2.801084 . 1.7004848 1.7526053 2.1170902 . . . . . 0 0 .  24.34779
             0 0 . 6.878675   .3373562 -2.763864 . 1.0090588 1.5797658 1.6744245 . . . . . 0 0 .  24.30974
             0 0 . 6.896047   .3469158 -2.655531 . 2.0730472 1.7911087  2.441974 . . . . . 0 0 .  24.35024
             0 0 . 7.152811  .28499976 -2.418561 . 3.2403915 3.0799816 2.8629184 . . . . . 0 0 .   24.4075
             0 0 . 7.129804  .29258543 -2.519349 .  2.423923  2.570989 2.9896774 . . . . . 0 0 .  24.41944
             0 0 . 7.113506    .300889 -2.411068 .  1.727542  2.480182  2.793149 . . . . . 0 0 . 24.436697
             0 0 . 6.931498    .317376 -2.671054 .  1.554339 2.1304839  2.970524 . . . . . 0 0 .  24.31324
             0 0 . 6.940572   .3216475 -2.801084 . 1.7004848 1.7526053 2.1170902 . . . . . 0 0 .  24.34779
             0 0 . 6.878675   .3373562 -2.763864 . 1.0090588 1.5797658 1.6744245 . . . . . 0 0 .  24.30974
             0 0 . 6.896047   .3469158 -2.655531 . 2.0730472 1.7911087  2.441974 . . . . . 0 0 .  24.35024
             0 0 . 7.113506    .300889 -2.411068 .  1.727542  2.480182  2.793149 . . . . . 0 0 . 24.436697
             0 0 . 7.013929   .3144341 -2.571222 . 1.1674504 2.1967888 1.8431436 . . . . . 0 0 .  24.36789
    -.56430537 0 . 6.896047   .3469158 -2.655531 . 2.0730472 1.7911087  2.441974 . . . . . 0 0 .  24.35024
             0 0 . 7.152811  .28499976 -2.418561 . 3.2403915 3.0799816 2.8629184 . . . . . 0 0 .   24.4075
             0 0 . 7.129804  .29258543 -2.519349 .  2.423923  2.570989 2.9896774 . . . . . 0 0 .  24.41944
             0 0 . 7.113506    .300889 -2.411068 .  1.727542  2.480182  2.793149 . . . . . 0 0 . 24.436697
             0 0 . 7.013929   .3144341 -2.571222 . 1.1674504 2.1967888 1.8431436 . . . . . 0 0 .  24.36789
             0 0 . 6.931498    .317376 -2.671054 .  1.554339 2.1304839  2.970524 . . . . . 0 0 .  24.31324
             0 0 . 6.940572   .3216475 -2.801084 . 1.7004848 1.7526053 2.1170902 . . . . . 0 0 .  24.34779
             0 0 . 6.878675   .3373562 -2.763864 . 1.0090588 1.5797658 1.6744245 . . . . . 0 0 .  24.30974
             0 0 . 6.896047   .3469158 -2.655531 . 2.0730472 1.7911087  2.441974 . . . . . 0 0 .  24.35024
             0 0 . 7.113506    .300889 -2.411068 .  1.727542  2.480182  2.793149 . . . . . 0 0 . 24.436697
             0 0 . 7.013929   .3144341 -2.571222 . 1.1674504 2.1967888 1.8431436 . . . . . 0 0 .  24.36789
             0 0 . 6.931498    .317376 -2.671054 .  1.554339 2.1304839  2.970524 . . . . . 0 0 .  24.31324
             0 0 . 6.940572   .3216475 -2.801084 . 1.7004848 1.7526053 2.1170902 . . . . . 0 0 .  24.34779
             0 0 . 6.878675   .3373562 -2.763864 . 1.0090588 1.5797658 1.6744245 . . . . . 0 0 .  24.30974
             0 0 . 6.896047   .3469158 -2.655531 . 2.0730472 1.7911087  2.441974 . . . . . 0 0 .  24.35024
             0 0 . 7.075285  .04483942  -2.50206 .  .4143925   3.10329  3.752835 . . . . . 0 0 .   24.2959
             0 0 . 7.152811  .28499976 -2.418561 . 3.2403915 3.0799816 2.8629184 . . . . . 0 0 .   24.4075
             0 0 . 7.129804  .29258543 -2.519349 .  2.423923  2.570989 2.9896774 . . . . . 0 0 .  24.41944
             0 0 . 7.113506    .300889 -2.411068 .  1.727542  2.480182  2.793149 . . . . . 0 0 . 24.436697
             0 0 . 7.013929   .3144341 -2.571222 . 1.1674504 2.1967888 1.8431436 . . . . . 0 0 .  24.36789
             0 0 . 6.931498    .317376 -2.671054 .  1.554339 2.1304839  2.970524 . . . . . 0 0 .  24.31324
             0 0 . 6.940572   .3216475 -2.801084 . 1.7004848 1.7526053 2.1170902 . . . . . 0 0 .  24.34779
             0 0 . 6.878675   .3373562 -2.763864 . 1.0090588 1.5797658 1.6744245 . . . . . 0 0 .  24.30974
             0 0 . 6.896047   .3469158 -2.655531 . 2.0730472 1.7911087  2.441974 . . . . . 0 0 .  24.35024
             0 0 . 7.152811  .28499976 -2.418561 . 3.2403915 3.0799816 2.8629184 . . . . . 0 0 .   24.4075
             0 0 . 7.129804  .29258543 -2.519349 .  2.423923  2.570989 2.9896774 . . . . . 0 0 .  24.41944
             0 0 . 7.113506    .300889 -2.411068 .  1.727542  2.480182  2.793149 . . . . . 0 0 . 24.436697
             0 0 . 7.013929   .3144341 -2.571222 . 1.1674504 2.1967888 1.8431436 . . . . . 0 0 .  24.36789
             0 0 . 6.931498    .317376 -2.671054 .  1.554339 2.1304839  2.970524 . . . . . 0 0 .  24.31324
             0 0 . 6.940572   .3216475 -2.801084 . 1.7004848 1.7526053 2.1170902 . . . . . 0 0 .  24.34779
             0 0 . 6.878675   .3373562 -2.763864 . 1.0090588 1.5797658 1.6744245 . . . . . 0 0 .  24.30974
             0 0 . 6.896047   .3469158 -2.655531 . 2.0730472 1.7911087  2.441974 . . . . . 0 0 .  24.35024
    -2.7105775 0 . 7.152811  .28499976 -2.418561 . 3.2403915 3.0799816 2.8629184 . . . . . 0 0 .   24.4075
      .9476042 0 . 7.129804  .29258543 -2.519349 .  2.423923  2.570989 2.9896774 . . . . . 0 0 .  24.41944
      .3676981 0 . 7.113506    .300889 -2.411068 .  1.727542  2.480182  2.793149 . . . . . 0 0 . 24.436697
     -.3913492 0 . 7.013929   .3144341 -2.571222 . 1.1674504 2.1967888 1.8431436 . . . . . 0 0 .  24.36789
     .06083497 0 . 6.931498    .317376 -2.671054 .  1.554339 2.1304839  2.970524 . . . . . 0 0 .  24.31324
    -.10954122 0 . 6.940572   .3216475 -2.801084 . 1.7004848 1.7526053 2.1170902 . . . . . 0 0 .  24.34779
     .06934997 0 . 6.878675   .3373562 -2.763864 . 1.0090588 1.5797658 1.6744245 . . . . . 0 0 .  24.30974
     .02848618 0 . 6.896047   .3469158 -2.655531 . 2.0730472 1.7911087  2.441974 . . . . . 0 0 .  24.35024
    end


    Thank you in advance!

    Kind regards,

    David



Working...
X