Announcement

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

  • Interpreting the coefficient signs using the random effect model

    Hi all,

    While running random effects regression with panel setting I'm experiencing the sign of the coefficient changing when I include the interaction term.

    Here is brief introduction of the data I'm working with [dataex attached at the end of the post]:

    1. OVERLAP_1 is a "time invariant" continuous variable (0 to 11).

    This is the main reason why I'm estimating with the random effects model, since fixed effects model would omit the results of time-invariant variables (due to collinearity).

    2. year variable is a binary indicator variable (0 if 2019 & 1 if 2020).

    3. OFF_AMT is the dependent variable.

    [Question]
    w/o the interaction term, the code goes:

    Code:
     xtset id date 
    xtreg OFF_AMT i.year OVERLAP_1, re
    which returns, negative coefficient for i.year & positive coefficient for OVERLAP_1.

    However, when I add an interaction term and change the code to:

    Code:
     xtset id date 
    xtreg OFF_AMT i.year##c.OVERLAP_1, re
    it would return positive coefficient for both individual i.year and OVERLAP_1, and negative coefficient for the interaction term i.year#c.OVERLAP_1

    Why does the sign on the coefficient for the i.year by itself changes when interaction term is included?

    As far as my understanding goes for interpreting the interaction term, the coefficient for the i.year represents the result for 1.year compared to 0.year, which to my understanding it should stay the same regardless of whether it is included in the interaction or not.

    My best guess so far is that including the interaction term:
    In the regression equation (I'm not 100% sure if this is the right equation): y = a + b1x1ti + b2x2ti +b3x1tix2ti + ei +ui

    "b3" the interaction term absorbs the portion of the explanation power which would otherwise have belonged to b1 & b2, thus causing the problem.

    However, something tells me that this is not the case...

    Could anyone shed further light on what is really going on here?

    Any advices or helps are appreciated in advance.

    I'm pretty new to STATA so this might not be the perfect representation of the original data, but here is the dataex example generated from the original dataset

    Thank you.

    My data looks like this:
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input double OFF_AMT float(id date year OVERLAP_1)
       1100 1183 3100 0  3
       1300 1257 3139 1  3
       1300  273 3116 0  0
       1300  689 3142 1  1
       1300  660 3072 0  6
       1300 1163 3082 0  6
       1400 1214 3084 0  6
       1400 1291 3082 0  5
       1500  545 3127 1  2
       2500  595 3123 1 10
       3500 1368 3077 0  4
       3700  591 3153 1  1
       4300 1010 3098 0  1
       4700 1256 3075 0  2
       5600   25 3156 1  8
      10400  716 3155 1  4
      11600  767 3108 0  4
      12000  442 3134 1  4
      13350  837 3099 0  3
      15400 1363 3129 1  4
      29500 1050 3101 0  3
      42600  884 3091 0  3
      45600  715 3109 0  0
      47800  570 3084 0  3
      70150  645 3096 0  8
      76900  398 3161 1  6
      85900 1167 3081 0  1
     130000  386 3159 1  6
     273500 1398 3089 0  2
     290200 1271 3163 1  0
     389600  937 3076 0  5
     398400  102 3136 1  9
     410450  869 3127 1  4
     890650  189 3095 0  3
     906300  169 3137 1  6
    1037300 1059 3129 1  6
    1048250  556 3104 0  1
    1112200  879 3079 0  3
    1123640  792 3148 1  2
    1198530  824 3103 0  4
    1217800  556 3159 1  1
    1238250  169 3159 1  6
    1242800  551 3120 1  5
    1320850  138 3159 1  0
    1382400 1321 3159 1  5
    1384800  556 3137 1  1
    1495264  169 3098 0  6
    1544800  264 3073 0  3
    1545200  803 3092 0  8
    1568500  668 3123 1  1
    1578750  541 3154 1  7
    1601500  101 3127 1  5
    1659600 1205 3154 1  5
    1681680 1205 3155 1  5
    1703200 1321 3123 1  5
    1711050  556 3073 0  1
    1729080 1366 3129 1  4
    1799700  541 3135 1  7
    1843870  541 3159 1  7
    1847600  541 3155 1  7
    1929550  944 3164 1  3
    1933970  541 3157 1  7
    1952400  668 3104 0  1
    1958150  541 3137 1  7
    1966600 1321 3104 0  5
    1985300  541 3134 1  7
    1996150  541 3158 1  7
    2011200   10 3159 1  3
    2022650 1268 3159 1  1
    2037450 1183 3098 0  3
    2042400  541 3153 1  7
    2073900  541 3150 1  7
    2090750  190 3073 0  3
    2095750  667 3151 1  2
    2100050  541 3147 1  7
    2118200 1407 3164 1  5
    2122460  541 3162 1  7
    2174400  541 3136 1  7
    2201900  169 3073 0  6
    2202040 1205 3165 1  5
    2205930  556 3123 1  1
    2212500  178 3070 0  4
    2215050 1205 3153 1  5
    2230650  541 3131 1  7
    2242070 1205 3157 1  5
    2256750  541 3156 1  7
    2257200   10 3137 1  3
    2264300  812 3123 1  4
    2267400  541 3170 1  7
    2269980  541 3142 1  7
    2274800  541 3163 1  7
    2286550  541 3148 1  7
    2309200  541 3146 1  7
    2314810  826 3159 1  0
    2317600 1205 3159 1  5
    2325400  541 3133 1  7
    2338950 1205 3156 1  5
    2339750  541 3141 1  7
    2344700 1257 3137 1  3
    2360600  541 3166 1  7
    2386650  541 3132 1  7
    2389900  541 3149 1  7
    2390500  541 3160 1  7
    2394750  589 3124 1  6
    2405750  660 3070 0  6
    2407600  541 3169 1  7
    2410900  541 3143 1  7
    2430550  541 3151 1  7
    2436730 1205 3161 1  5
    2443050  684 3159 1  1
    2445190  541 3145 1  7
    2446550  660 3123 1  6
    2447860 1205 3150 1  5
    2450200  541 3165 1  7
    2461320  541 3164 1  7
    2510850  720 3090 0  0
    2515850  541 3140 1  7
    2524550  541 3144 1  7
    2528380 1205 3152 1  5
    2530700  541 3152 1  7
    2538950  138 3123 1  0
    2549050 1375 3135 1  5
    2550980 1205 3163 1  5
    2564050  541 3128 1  7
    2584690  169 3150 1  6
    2585240  541 3138 1  7
    2591450  541 3168 1  7
    2605810 1205 3148 1  5
    2646530 1205 3162 1  5
    2653150 1113 3104 0  3
    2666950  541 3139 1  7
    2668950  556 3107 0  1
    2675100  556 3090 0  1
    2680450 1113 3159 1  3
    2681000  660 3159 1  6
    2683300  684 3123 1  1
    2704050  541 3130 1  7
    2713930 1205 3151 1  5
    2730400  556 3138 1  1
    2740750  592 3159 1  6
    2744300 1291 3080 0  5
    2746850 1205 3160 1  5
    2760650 1205 3168 1  5
    2769650 1113 3123 1  3
    2770510  247 3083 0  4
    2770950  541 3129 1  7
    2794050  169 3160 1  6
    2797400 1205 3128 1  5
    2832300  541 3167 1  7
    2841600 1205 3166 1  5
    2846600 1045 3159 1  4
    2847450  556 3120 1  1
    2862100 1205 3169 1  5
    2862428  443 3159 1  0
    2879350  138 3104 0  0
    2879900 1010 3096 0  1
    2888921 1255 3159 1 10
    2898450  541 3127 1  7
    2899500  412 3104 0  6
    2901700  169 3085 0  6
    2913300   35 3091 0  3
    2924000  991 3159 1  4
    2937370  541 3123 1  7
    2949550  556 3108 0  1
    2954650 1408 3159 1  1
    2965610 1205 3140 1  5
    2993200  322 3068 0  1
    2995600  866 3159 1  5
    3007240 1205 3132 1  5
    3007500 1253 3159 1  7
    3015000  684 3104 0  1
    3026800  643 3104 0  4
    3041850   93 3146 1  3
    3042250 1205 3146 1  5
    3044000  169 3162 1  6
    3050000  812 3159 1  4
    3069700  812 3104 0  4
    3073400  488 3123 1  2
    3092200  991 3123 1  4
    3100950  970 3159 1  1
    3101960  970 3123 1  1
    3109700 1282 3073 0  2
    3130450  556 3152 1  1
    3140000  781 3123 1  2
    3147400  850 3123 1  6
    3149300  556 3100 0  1
    3184420 1205 3133 1  5
    3186300  556 3109 0  1
    3191700 1205 3164 1  5
    3207000  541 3161 1  7
    3208800  169 3151 1  6
    3214550  215 3123 1  6
    3224900 1268 3123 1  1
    3228700   10 3123 1  3
    3232250  826 3123 1  0
    3233520  541 3126 1  7
    3234810 1205 3167 1  5
    3245450 1205 3147 1  5
    3256000 1205 3134 1  5
    3259350  169 3166 1  6
    3259980 1205 3149 1  5
    3264600  541 3120 1  7
    3265520 1205 3145 1  5
    3280300  826 3137 1  0
    3295070 1205 3143 1  5
    3299900  379 3084 0  0
    3300550  556 3146 1  1
    3314090  655 3123 1  4
    3315300  169 3135 1  6
    3318950  169 3143 1  6
    3320750 1165 3081 0  2
    3323000  556 3122 1  1
    3325960 1205 3142 1  5
    3330800  668 3159 1  1
    3332500  488 3073 0  2
    3333440 1205 3139 1  5
    3334300  541 3125 1  7
    3336850  556 3070 0  1
    3360810  556 3129 1  1
    3362450 1241 3159 1  9
    3368880 1205 3136 1  5
    3377100  286 3149 1  4
    3389500  169 3123 1  6
    3390760 1205 3131 1  5
    3391850  169 3161 1  6
    3392800 1408 3104 0  1
    3400950   10 3104 0  3
    3405250  517 3159 1  4
    3405500  169 3163 1  6
    3405500  368 3123 1  2
    3411450  556 3081 0  1
    3412100  169 3142 1  6
    3414280  556 3128 1  1
    3422400 1205 3129 1  5
    3426670 1282 3114 0  2
    3434450  286 3164 1  4
    3435900 1205 3144 1  5
    3438460 1205 3141 1  5
    3438620 1205 3104 0  5
    3453350  286 3162 1  4
    3457650 1150 3091 0  6
    3459400 1205 3135 1  5
    3472219  169 3100 0  6
    3473900 1023 3104 0  2
    3474750  169 3120 1  6
    3478300  655 3159 1  4
    3487730  353 3123 1  3
    3496900 1268 3104 0  1
    3499650 1378 3123 1  3
    3501900  169 3156 1  6
    3509700 1205 3127 1  5
    3510050  329 3080 0  6
    3524920 1205 3130 1  5
    3526650  169 3152 1  6
    3530960  556 3135 1  1
    3536400 1321 3072 0  5
    3540350   10 3073 0  3
    3546650   26 3159 1  7
    3549160  169 3145 1  6
    3567800  541 3124 1  7
    3568450  541 3104 0  7
    3568800  688 3159 1  6
    3568850  169 3090 0  6
    3572840  556 3160 1  1
    3577040  541 3117 0  7
    3577300  165 3159 1  4
    3579150 1132 3135 1  6
    3583700  286 3163 1  4
    3603200  541 3122 1  7
    3608560  556 3121 1  1
    3615550   10 3100 0  3
    3619650  169 3155 1  6
    3621750  556 3125 1  1
    3627800  541 3108 0  7
    3630600  286 3147 1  4
    3632200  556 3103 0  1
    3638100 1000 3104 0  6
    3639400 1205 3125 1  5
    3643350 1268 3073 0  1
    3669770  169 3153 1  6
    3678000  556 3126 1  1
    3678100  488 3120 1  2
    3679500  345 3159 1  5
    3682000  286 3166 1  4
    3686350  286 3142 1  4
    3698650  286 3152 1  4
    3707300  169 3141 1  6
    3719850  558 3159 1  4
    3726650 1282 3104 0  2
    3729800  828 3159 1  8
    3733000  368 3159 1  2
    3734800  995 3113 0  8
    3736560  169 3076 0  6
    3741450  541 3107 0  7
    3748400  660 3128 1  6
    3750200  655 3104 0  4
    3756250 1000 3159 1  6
    3758750 1190 3168 1  1
    3760000  169 3107 0  6
    3764850  169 3140 1  6
    3765420  556 3133 1  1
    3765550  286 3169 1  4
    3766800 1282 3109 0  2
    3776700  541 3111 0  7
    3779400  556 3094 0  1
    3780350  541 3116 0  7
    3786750  138 3072 0  0
    3787150  286 3160 1  4
    3790500 1321 3073 0  5
    3798750  169 3134 1  6
    3802250  556 3101 0  1
    3810500 1256 3073 0  2
    3814150  286 3143 1  4
    3814800  608 3159 1  4
    3815250  169 3068 0  6
    3820650  763 3123 1  0
    3823250  443 3104 0  0
    3833150 1166 3159 1  8
    3833700 1035 3104 0  2
    3834900 1241 3104 0  9
    3843300  700 3159 1  2
    3845050  590 3120 1  7
    3845250   10 3085 0  3
    3849850   27 3123 1  6
    3850040 1268 3137 1  1
    3852700  286 3144 1  4
    3858740  556 3147 1  1
    3862650  933 3159 1  9
    3870320  933 3123 1  9
    3871600  556 3139 1  1
    3881550  556 3095 0  1
    3882050  215 3104 0  6
    3883250  286 3150 1  4
    3885580 1205 3124 1  5
    3886550  169 3133 1  6
    3897250   88 3159 1  7
    3908500   11 3159 1  2
    3909930  169 3147 1  6
    3913450 1282 3072 0  2
    3913600  286 3151 1  4
    3919750  556 3127 1  1
    3920650  488 3121 1  2
    3920900  541 3112 0  7
    3927950 1282 3124 1  2
    3930650   98 3159 1  5
    3932200  822 3102 0  6
    3932900  556 3087 0  1
    3935850  169 3164 1  6
    3935950  169 3154 1  6
    3936850  286 3115 0  4
    3937000  556 3156 1  1
    3945200  919 3114 0  3
    3953150  169 3169 1  6
    3954400  541 3118 0  7
    3960250  686 3159 1  2
    3965200  443 3123 1  0
    3975350  169 3108 0  6
    3978050 1282 3108 0  2
    3979700  286 3148 1  4
    3986550  368 3104 0  2
    3986600  556 3150 1  1
    3992000  169 3138 1  6
    4002700  556 3083 0  1
    4008900  488 3069 0  2
    4010150  286 3145 1  4
    4015450  850 3104 0  6
    4017450 1282 3120 1  2
    4017700 1282 3116 0  2
    4021200  169 3157 1  6
    4022750  999 3123 1  1
    4031250  440 3145 1  4
    4031500  388 3159 1  7
    4031700  488 3104 0  2
    4036550  556 3077 0  1
    4037100  368 3073 0  2
    4038100  397 3159 1  4
    4039420 1205 3126 1  5
    4040050  286 3161 1  4
    4043600  286 3159 1  4
    4043700  286 3153 1  4
    4048300  169 3144 1  6
    4049200  541 3115 0  7
    4053750 1282 3125 1  2
    4054650 1000 3123 1  6
    4055440  556 3102 0  1
    4056100  169 3124 1  6
    4059450  488 3068 0  2
    4059550  169 3136 1  6
    4062130  169 3149 1  6
    4062900  120 3159 1  6
    4063650  668 3072 0  1
    4066330  556 3164 1  1
    4066800  556 3096 0  1
    4074450  541 3121 1  7
    4075050  820 3123 1  1
    4076500 1271 3165 1  0
    4080500   10 3152 1  3
    4084450  556 3151 1  1
    4085750  739 3123 1  4
    4089150   10 3072 0  3
    4090200  647 3070 0  7
    4090350  286 3155 1  4
    4098150  264 3159 1  3
    4102750 1282 3107 0  2
    4104100  286 3141 1  4
    4105010 1205 3094 0  5
    4109150  556 3140 1  1
    4109650  169 3110 0  6
    4116750  551 3122 1  5
    4118000  169 3165 1  6
    4119850  169 3148 1  6
    4122650  169 3128 1  6
    4128750 1282 3097 0  2
    4131150  660 3129 1  6
    4133150  169 3086 0  6
    4133800 1282 3094 0  2
    4135750  541 3109 0  7
    4140730  556 3110 0  1
    4142330 1205 3100 0  5
    4145050  286 3104 0  4
    4148500  286 3146 1  4
    4152850 1268 3072 0  1
    4155600  592 3123 1  6
    4156840 1282 3110 0  2
    4158450 1113 3099 0  3
    4158850  488 3072 0  2
    4163100  488 3114 0  2
    4163850 1282 3090 0  2
    4163950  286 3165 1  4
    4164800 1378 3159 1  3
    4166750  850 3159 1  6
    4167050  286 3122 1  4
    4168050  928 3102 0  1
    4172050  286 3102 0  4
    4178300  541 3110 0  7
    4183350  556 3079 0  1
    4183750  488 3095 0  2
    4188250 1268 3152 1  1
    4189250  488 3159 1  2
    4189600  556 3071 0  1
    4189830  556 3076 0  1
    4190050  286 3158 1  4
    4191350 1266 3141 1  4
    4192530 1205 3138 1  5
    4199600 1113 3148 1  3
    4202850  169 3139 1  6
    4210500  488 3115 0  2
    4210950  999 3159 1  1
    4212150  613 3123 1  2
    4212300 1205 3137 1  5
    4214100  556 3149 1  1
    4214800  936 3159 1 10
    4218300  556 3088 0  1
    4222200  541 3114 0  7
    4223100 1282 3095 0  2
    4223300  286 3113 0  4
    4223550 1411 3070 0  0
    4225500  556 3097 0  1
    4228100  182 3135 1  3
    4230400  593 3159 1  9
    4234850  518 3123 1  4
    4242350 1378 3104 0  3
    4242950  937 3074 0  5
    4243100 1282 3096 0  2
    4254740  286 3107 0  4
    4255050  286 3095 0  4
    4260850  286 3156 1  4
    4261250  286 3105 0  4
    4262700  556 3085 0  1
    4263050  541 3105 0  7
    4264020 1282 3103 0  2
    4264750  556 3165 1  1
    4267700 1321 3098 0  5
    4270680  556 3072 0  1
    4272750  826 3104 0  0
    4274000 1113 3147 1  3
    4274750 1282 3098 0  2
    4275400  556 3155 1  1
    4279800 1321 3097 0  5
    4280750 1282 3091 0  2
    4283260  169 3111 0  6
    4285510  169 3081 0  6
    4286500  286 3109 0  4
    4286750  286 3111 0  4
    4288150  608 3137 1  4
    4291450 1113 3142 1  3
    4293200 1113 3163 1  3
    4294100 1113 3103 0  3
    4296250 1282 3127 1  2
    4297100  286 3137 1  4
    4298750  120 3151 1  6
    4301350  286 3114 0  4
    4301400  169 3091 0  6
    4303500   10 3135 1  3
    4307120  556 3082 0  1
    4312250  613 3159 1  2
    4318450 1045 3123 1  4
    4319450  286 3101 0  4
    4321600  286 3131 1  4
    4323600  169 3129 1  6
    4325550  286 3092 0  4
    4328100 1113 3114 0  3
    4333900  739 3104 0  4
    4335000  169 3168 1  6
    4338350 1113 3141 1  3
    4339050  286 3093 0  4
    4339850  169 3146 1  6
    4341150  286 3168 1  4
    4341700  286 3167 1  4
    4343450 1321 3099 0  5
    4348700  169 3115 0  6
    4348940  556 3143 1  1
    4354700 1408 3123 1  1
    4358390 1205 3103 0  5
    4359750  970 3104 0  1
    4362150 1282 3123 1  2
    4364250  286 3123 1  4
    4365000  169 3077 0  6
    4366250    4 3097 0  1
    4367750 1321 3100 0  5
    4370350  488 3070 0  2
    4371300  541 3106 0  7
    4371750  541 3096 0  7
    4373300  541 3085 0  7
    4375900 1321 3096 0  5
    4375960 1205 3170 1  5
    4376400  488 3100 0  2
    4380300  169 3116 0  6
    4384600  488 3111 0  2
    4385800 1205 3121 1  5
    4391450  286 3100 0  4
    4393250  784 3098 0  4
    4393350  169 3087 0  6
    4402850  286 3170 1  4
    4403500 1282 3111 0  2
    4404800 1113 3107 0  3
    4404800  660 3153 1  6
    4409250  286 3099 0  4
    4409900 1282 3115 0  2
    4410050  138 3073 0  0
    4412200  264 3123 1  3
    4412800 1113 3121 1  3
    4413800  264 3104 0  3
    4414200  286 3127 1  4
    4418200  668 3153 1  1
    4418850 1282 3122 1  2
    4420700 1282 3093 0  2
    4421530  541 3113 0  7
    4421650  286 3097 0  4
    4427450  682 3152 1  8
    4429350  684 3073 0  1
    4431250  682 3104 0  8
    4431350  398 3104 0  6
    4432000 1113 3108 0  3
    4436000  826 3073 0  0
    4437150  488 3071 0  2
    4440950 1321 3149 1  5
    4441030  556 3105 0  1
    4441600 1113 3116 0  3
    4444950  286 3121 1  4
    4446650  488 3110 0  2
    4448350  286 3096 0  4
    4448800  541 3093 0  7
    4449150 1282 3117 0  2
    4453500 1241 3123 1  9
    4455080  556 3141 1  1
    4455700  668 3154 1  1
    4455800  169 3132 1  6
    4457850 1113 3166 1  3
    4460300  286 3091 0  4
    4460900  725 3099 0  2
    4462130  556 3124 1  1
    4462950  488 3098 0  2
    4464950  286 3117 0  4
    4465250 1321 3126 1  5
    4465300 1113 3146 1  3
    4467250  120 3154 1  6
    4469220  402 3137 1  7
    4470350  169 3109 0  6
    4470800  826 3120 1  0
    4472500  556 3086 0  1
    4474100  286 3094 0  4
    4477250  286 3116 0  4
    4478400 1282 3099 0  2
    4479750  169 3125 1  6
    4484130 1366 3099 0  4
    4485120  120 3152 1  6
    4488080  556 3098 0  1
    4489000 1282 3102 0  2
    4493300  215 3159 1  6
    4493500 1321 3143 1  5
    4498000 1282 3088 0  2
    4498550 1256 3123 1  2
    4500400  886 3107 0  4
    4500750  592 3104 0  6
    4502000  488 3103 0  2
    4504450  301 3109 0  0
    4506100  792 3150 1  2
    4506650  556 3131 1  1
    4506800   88 3123 1  7
    4507000  541 3103 0  7
    4508100 1113 3150 1  3
    4509050  286 3090 0  4
    4509200  286 3140 1  4
    4509400  286 3133 1  4
    4510050 1035 3159 1  2
    4510300  784 3104 0  4
    4513700  541 3091 0  7
    4514500 1282 3113 0  2
    4515350  286 3098 0  4
    4515400 1113 3149 1  3
    4519400  286 3103 0  4
    4520950  684 3164 1  1
    4521400  488 3125 1  2
    4521900  556 3069 0  1
    4526580  556 3080 0  1
    4527100  541 3090 0  7
    4528000 1282 3082 0  2
    4532850  660 3130 1  6
    4535950  169 3099 0  6
    4536300 1282 3068 0  2
    4537100 1326 3123 1  3
    4538880  541 3094 0  7
    4542100  120 3164 1  6
    4542300  660 3154 1  6
    4546870  541 3089 0  7
    4550600  882 3159 1  3
    4552900  120 3115 0  6
    4557000 1282 3100 0  2
    4558800  649 3073 0  6
    4560400 1282 3081 0  2
    4561750 1282 3083 0  2
    4563300 1113 3109 0  3
    4566760 1321 3117 0  5
    4568950  286 3134 1  4
    4571300  169 3131 1  6
    4573600 1113 3158 1  3
    4574750  541 3100 0  7
    4576800  286 3088 0  4
    4576905  488 3128 1  2
    4578250  286 3157 1  4
    4580400  286 3120 1  4
    4582050   10 3156 1  3
    4588350 1282 3101 0  2
    4593150  286 3106 0  4
    4593410 1270 3088 0  1
    4595400  120 3163 1  6
    4598400  286 3110 0  4
    4600690  169 3102 0  6
    4606650  286 3108 0  4
    4609600  286 3136 1  4
    4613850  286 3124 1  4
    4614250  488 3099 0  2
    4616450  197 3123 1  6
    4617100 1113 3143 1  3
    4617100  944 3165 1  3
    4618000  488 3090 0  2
    4619410 1205 3122 1  5
    4619700 1321 3146 1  5
    4621250  613 3104 0  2
    4621950 1321 3122 1  5
    4623700  402 3159 1  7
    4625950  286 3125 1  4
    4630675 1205 3088 0  5
    4631950 1321 3120 1  5
    4632700 1113 3165 1  3
    4633060 1189 3159 1  3
    4633350 1321 3151 1  5
    4633650  682 3123 1  8
    4635000  120 3150 1  6
    4642750  120 3153 1  6
    4645050 1113 3164 1  3
    4645950  286 3139 1  4
    4646040 1321 3147 1  5
    4647750 1282 3121 1  2
    4648450 1321 3152 1  5
    4650400  596 3159 1 10
    4650642  169 3083 0  6
    4651550   88 3073 0  7
    4653100  488 3124 1  2
    4653550  556 3144 1  1
    4655900 1321 3153 1  5
    4657460  353 3159 1  3
    4661750  286 3128 1  4
    4662700  169 3101 0  6
    4663300  120 3104 0  6
    4663750  541 3095 0  7
    4665750  556 3142 1  1
    4668600  688 3123 1  6
    4668950  169 3167 1  6
    4670842  169 3082 0  6
    4672900 1321 3103 0  5
    4674550 1282 3105 0  2
    4677500 1282 3106 0  2
    4678050  120 3160 1  6
    4685200 1321 3145 1  5
    4685300  704 3123 1  4
    4685550  870 3159 1  6
    4685900  660 3135 1  6
    4687000 1175 3159 1  8
    4688400 1175 3068 0  8
    4689750  541 3097 0  7
    4691100 1113 3160 1  3
    4692350  649 3123 1  6
    4695700  763 3104 0  0
    4696300 1321 3142 1  5
    4697900  488 3112 0  2
    4703740  541 3102 0  7
    4706250  668 3073 0  1
    4707950   25 3159 1  8
    4709700  945 3159 1  4
    4713950  649 3159 1  6
    4718000  286 3080 0  4
    4719550  169 3095 0  6
    4720840 1205 3087 0  5
    4721200 1113 3131 1  3
    4722000 1205 3107 0  5
    4722100 1321 3162 1  5
    4723200 1113 3117 0  3
    4724840  169 3114 0  6
    4725850  286 3154 1  4
    4725900   27 3100 0  6
    4726050 1113 3105 0  3
    4728050  169 3106 0  6
    4731140 1113 3095 0  3
    4731400 1282 3092 0  2
    4735800  770 3104 0  1
    4737050  488 3127 1  2
    4737600  169 3105 0  6
    4738460  120 3127 1  6
    4739500 1113 3094 0  3
    4741450  541 3086 0  7
    4747550  933 3104 0  9
    4748650  286 3112 0  4
    4749650  488 3075 0  2
    4750050 1113 3145 1  3
    4753300  935 3159 1 10
    4753600  345 3123 1  5
    4753700 1282 3118 0  2
    4754250  120 3149 1  6
    4754800 1282 3084 0  2
    4755250 1321 3136 1  5
    4761250 1282 3143 1  2
    4761450  824 3123 1  4
    4763100  684 3072 0  1
    4763300  739 3159 1  4
    4764860  556 3113 0  1
    4767250 1205 3120 1  5
    4768350 1113 3162 1  3
    4770150  286 3126 1  4
    4770750  286 3132 1  4
    4776500 1282 3071 0  2
    4776900 1282 3089 0  2
    4779870  660 3155 1  6
    4780000  682 3159 1  8
    4780550  556 3099 0  1
    4784670 1205 3090 0  5
    4786450 1321 3107 0  5
    4786800  286 3079 0  4
    4786950  660 3131 1  6
    4794150  541 3080 0  7
    4794200   10 3107 0  3
    4795150   88 3170 1  7
    4799300 1321 3095 0  5
    4799750  643 3159 1  4
    4800550   98 3104 0  5
    4801020  541 3101 0  7
    4803000 1321 3144 1  5
    4803000  668 3114 0  1
    4806800   88 3152 1  7
    4809300  286 3089 0  4
    4809350   27 3104 0  6
    4810300  120 3143 1  6
    4810650 1321 3094 0  5
    4810900  541 3081 0  7
    4811900  286 3138 1  4
    4812220  488 3164 1  2
    4814400 1113 3169 1  3
    4814450  286 3084 0  4
    4817150  120 3123 1  6
    4818150 1113 3098 0  3
    4820800 1205 3082 0  5
    4821500  412 3072 0  6
    4824740 1282 3142 1  2
    4824850  553 3134 1  7
    4825650   10 3160 1  3
    4830700 1113 3072 0  3
    4840100 1113 3111 0  3
    4841210 1205 3089 0  5
    4842150 1067 3159 1  7
    4846750  488 3108 0  2
    4847575 1205 3091 0  5
    4850200 1321 3118 0  5
    4853100  120 3165 1  6
    4853284  169 3094 0  6
    4854350 1035 3093 0  2
    4856200  660 3136 1  6
    4858800  286 3081 0  4
    4861950  142 3159 1  0
    4870150 1035 3091 0  2
    4871630  541 3082 0  7
    4871700 1321 3101 0  5
    4872100 1113 3151 1  3
    4873000  169 3130 1  6
    4874500  784 3123 1  4
    4875350 1113 3100 0  3
    4875900 1113 3101 0  3
    4877300  169 3084 0  6
    4879600   98 3150 1  5
    4879930 1113 3152 1  3
    4881500  120 3145 1  6
    4881550  684 3168 1  1
    4882270  805 3123 1  4
    4883550 1321 3169 1  5
    4884150 1205 3101 0  5
    4885250 1282 3070 0  2
    4886320 1282 3069 0  2
    4886500   88 3098 0  7
    4887370  556 3074 0  1
    4889910  364 3163 1  3
    4890300  386 3160 1  6
    4890725 1205 3078 0  5
    4891200 1035 3090 0  2
    4894250  169 3093 0  6
    4895700  541 3099 0  7
    4896950 1282 3087 0  2
    4898650  983 3123 1  3
    4900350 1045 3104 0  4
    4901850   10 3090 0  3
    4902640  169 3096 0  6
    4902990  120 3146 1  6
    4903100 1321 3170 1  5
    4907150  169 3069 0  6
    4908050 1321 3166 1  5
    4910150  488 3102 0  2
    4910850 1321 3090 0  5
    4913900 1271 3123 1  0
    4917250 1321 3093 0  5
    4917650  541 3087 0  7
    4918000 1113 3155 1  3
    4921950 1321 3121 1  5
    4921950  660 3156 1  6
    4923250  541 3088 0  7
    4923630 1205 3092 0  5
    4926598  556 3148 1  1
    4928050   10 3068 0  3
    4931150 1035 3123 1  2
    4931250   88 3143 1  7
    4933700  136 3159 1  0
    4933800 1321 3163 1  5
    4937030 1035 3096 0  2
    4939100  920 3104 0  4
    4940250  488 3131 1  2
    4940820  169 3127 1  6
    4941600 1035 3100 0  2
    4942160  556 3084 0  1
    4942450  286 3135 1  4
    4945400  488 3122 1  2
    4946750  286 3085 0  4
    4946900  668 3158 1  1
    4952000  277 3159 1  4
    4955450  541 3092 0  7
    4957220  169 3080 0  6
    4957900  120 3157 1  6
    4959900 1113 3093 0  3
    4960950 1321 3131 1  5
    4961371 1205 3106 0  5
    4965600 1282 3135 1  2
    4966850  286 3072 0  4
    4970000  660 3150 1  6
    4970850 1321 3158 1  5
    4974650  820 3159 1  1
    4975450  684 3134 1  1
    4977200  784 3159 1  4
    4977300  120 3155 1  6
    4978200  488 3086 0  2
    4978800  488 3129 1  2
    4979650   88 3133 1  7
    4980200  556 3089 0  1
    4982400  488 3135 1  2
    4982960 1205 3083 0  5
    4988150  169 3070 0  6
    4989800  488 3132 1  2
    4993510  169 3088 0  6
    4994850 1035 3143 1  2
    4995910  266 3098 0  1
    4997300  541 3084 0  7
    4997700 1035 3142 1  2
    4999050   10 3143 1  3
    4999700  811 3159 1  5
    5003500 1268 3160 1  1
    5003850   27 3159 1  6
    5004400  882 3104 0  3
    5005300  983 3104 0  3
    5006000  850 3073 0  6
    5006250   10 3150 1  3
    5009850 1113 3144 1  3
    5010100  828 3104 0  8
    5010200  488 3081 0  2
    5011500  488 3074 0  2
    5012300  488 3109 0  2
    5012750 1321 3115 0  5
    5013300 1321 3111 0  5
    5015000 1113 3127 1  3
    5017550  890 3159 1  6
    5017850  556 3078 0  1
    5018150  266 3149 1  1
    5018300  558 3104 0  4
    5018450  488 3084 0  2
    5019650  660 3134 1  6
    5020050  488 3116 0  2
    5021250  488 3107 0  2
    5023750 1321 3157 1  5
    5029350  120 3169 1  6
    5030400 1321 3154 1  5
    5036450 1159 3108 0  7
    5036900  120 3116 0  6
    5037950 1282 3085 0  2
    5039926  541 3079 0  7
    5040350  169 3089 0  6
    5040450 1321 3141 1  5
    5040700 1166 3123 1  8
    5042300  488 3079 0  2
    5042338 1205 3073 0  5
    5044500   88 3163 1  7
    5046100  556 3075 0  1
    5046350 1113 3168 1  3
    5049550  541 3098 0  7
    5052550 1282 3079 0  2
    5053100   10 3144 1  3
    5055500 1035 3092 0  2
    5056200   88 3149 1  7
    5057630  933 3073 0  9
    5058940 1366 3100 0  4
    5059000 1321 3091 0  5
    5059550   88 3168 1  7
    5060550  306 3123 1  9
    5060800  120 3166 1  6
    5061100  488 3091 0  2
    5062050  488 3097 0  2
    5062200 1205 3111 0  5
    5062650  169 3121 1  6
    5064000  826 3098 0  0
    5064300  120 3120 1  6
    5066450  556 3116 0  1
    5067150  488 3136 1  2
    5068500 1205 3102 0  5
    5069400 1321 3161 1  5
    5070600 1113 3132 1  3
    5075150  991 3104 0  4
    5077730 1205 3096 0  5
    5078350 1113 3124 1  3
    5080000 1321 3127 1  5
    5081150 1268 3068 0  1
    5084950 1113 3106 0  3
    5085000 1205 3105 0  5
    5085450  330 3159 1  5
    5085485 1205 3070 0  5
    5087000   98 3123 1  5
    5091900 1113 3085 0  3
    5092590  556 3161 1  1
    5093150  120 3156 1  6
    5095650 1321 3110 0  5
    5097000 1321 3092 0  5
    5097250   10 3108 0  3
    5097440 1255 3123 1 10
    5099350 1321 3102 0  5
    5099750   88 3094 0  7
    5099950  169 3079 0  6
    5100000  820 3104 0  1
    5100750  696 3159 1  6
    5100960  169 3097 0  6
    5103850 1113 3073 0  3
    5104850  684 3166 1  1
    5105250  488 3162 1  2
    5105320 1205 3086 0  5
    5107200  781 3104 0  2
    5107550  412 3123 1  6
    5108800  136 3104 0  0
    5112300 1205 3110 0  5
    5112450 1282 3077 0  2
    5113350  511 3159 1  6
    5115930  556 3130 1  1
    5116550  668 3098 0  1
    5122600 1205 3117 0  5
    5122850  668 3099 0  1
    5124450  488 3106 0  2
    5125350 1321 3135 1  5
    5125450  120 3132 1  6
    5125500  154 3159 1  5
    5125800 1113 3157 1  3
    5127500 1321 3114 0  5
    5128650 1113 3153 1  3
    5129200  541 3083 0  7
    5130400 1035 3150 1  2
    5130450 1113 3120 1  3
    5130550 1321 3164 1  5
    5131600  649 3151 1  6
    5132150  120 3162 1  6
    5132470  886 3109 0  4
    end
    format %tw date
    label values year year
    label def year 0 "2019년도", modify
    label def year 1 "2020년도", modify

  • #2
    Vincent:
    welcome to this forum.
    1) -OVERLAP_1- is a discrete variable that takes on integers only;
    2) as per 1), interaction should be between discrete variables;
    3) as you have 174 panels, cluster-robust standard errors is highly advisable;
    4) you should perform -xttest0- after -xtreg,re- to investigate the evidence of a panel-wise effect.
    That said:
    Code:
    . xtreg OFF_AMT i.year##i.OVERLAP_1, re vce(cluster id) allbase
    note: 0.year#10.OVERLAP_1 identifies no observations in the sample.
    note: 1.year#10.OVERLAP_1 omitted because of collinearity.
    
    Random-effects GLS regression                   Number of obs     =      1,000
    Group variable: id                              Number of groups  =        174
    
    R-squared:                                      Obs per group:
         Within  = 0.1915                                         min =          1
         Between = 0.0159                                         avg =        5.7
         Overall = 0.0121                                         max =         91
    
                                                    Wald chi2(20)     =     155.87
    corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
    
                                         (Std. err. adjusted for 174 clusters in id)
    --------------------------------------------------------------------------------
                   |               Robust
           OFF_AMT | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
    ---------------+----------------------------------------------------------------
              year |
             2019  |          0  (base)
             2020  |  -843083.1   304637.8    -2.77   0.006     -1440162   -246004.1
                   |
         OVERLAP_1 |
                0  |          0  (base)
                1  |  -105990.8   590514.7    -0.18   0.858     -1263378     1051397
                2  |  -176769.1   582576.2    -0.30   0.762     -1318597    965059.3
                3  |  -762398.8   611649.9    -1.25   0.213     -1961210      436413
                4  |  -113333.5   565587.4    -0.20   0.841     -1221864    995197.4
                5  |   492796.5   730968.7     0.67   0.500    -939875.8     1925469
                6  |   189882.6   578652.8     0.33   0.743    -944256.1     1324021
                7  |    1904764   527278.6     3.61   0.000     871317.1     2938211
                8  |  -341884.9   821409.9    -0.42   0.677     -1951819     1268049
                9  |   561332.2   848937.1     0.66   0.508     -1102554     2225218
               10  |   775652.4   916202.1     0.85   0.397     -1020071     2571376
                   |
    year#OVERLAP_1 |
          2019# 0  |          0  (base)
          2019# 1  |          0  (base)
          2019# 2  |          0  (base)
          2019# 3  |          0  (base)
          2019# 4  |          0  (base)
          2019# 5  |          0  (base)
          2019# 6  |          0  (base)
          2019# 7  |          0  (base)
          2019# 8  |          0  (base)
          2019# 9  |          0  (base)
          2019#10  |          0  (empty)
          2020# 0  |          0  (base)
          2020# 1  |   570643.2   311488.6     1.83   0.067    -39863.14     1181150
          2020# 2  |   847171.7   317398.4     2.67   0.008     225082.3     1469261
          2020# 3  |   961645.3   331915.2     2.90   0.004     311103.4     1612187
          2020# 4  |   572856.6   329291.1     1.74   0.082    -72542.08     1218255
          2020# 5  |  -1185.245   653386.9    -0.00   0.999     -1281800     1279429
          2020# 6  |   592619.1   423707.3     1.40   0.162    -237832.1     1423070
          2020# 7  |  -930214.6   382546.8    -2.43   0.015     -1679993   -180436.6
          2020# 8  |   927974.3   514536.5     1.80   0.071    -80498.64     1936447
          2020# 9  |     192358   495309.8     0.39   0.698    -778431.5     1163147
          2020#10  |          0  (omitted)
                   |
             _cons |    3603085   478723.1     7.53   0.000      2664805     4541365
    ---------------+----------------------------------------------------------------
           sigma_u |  1355864.2
           sigma_e |   773899.5
               rho |  .75426769   (fraction of variance due to u_i)
    --------------------------------------------------------------------------------
    
    . xttest0
    
    Breusch and Pagan Lagrangian multiplier test for random effects
    
            OFF_AMT[id,t] = Xb + u[id] + e[id,t]
    
            Estimated results:
                             |       Var     SD = sqrt(Var)
                    ---------+-----------------------------
                     OFF_AMT |   1.32e+12        1149653
                           e |   5.99e+11       773899.5
                           u |   1.84e+12        1355864
    
            Test: Var(u) = 0
                                 chibar2(01) =   133.06
                              Prob > chibar2 =   0.0000
    
    .
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Carlo, thank you very much for the detailed instructions!

      1) I should have noticed that the OVERLAP_1 indeed consists only of integers.
      However, for some reason in the main data set with 945 panels, I still see the sign changes for the i.year variable when interacted with i.OVERLAP_1
      Click image for larger version

Name:	c2.png
Views:	1
Size:	72.9 KB
ID:	1650160

      2) Running the Breush and Pagan Lagrangian multiplier test yields p-value: 0.0000, which to my understanding reject the null: variance of individual error terms is 0, thus suggesting I should stick with random effects model.

      So, it would mean that the model specification isn't wrong..., but the sign still changes for i.year for some reason.

      (btw, w/o interaction term it still yields negative sign for the i.year coefficient)

      What could be causing the problem to persist in the main data?

      Comment


      • #4
        Vincent:
        time seems to have a declining effect when interacted with -OVERLAP_1-.
        It is difficult to say whether this makes sense or not, as it may depend on same theoretical reason that I ignore.
        That said, -xttest0- outcome tells you that your dataset supports the evidence of a panel-wise effect, which is something different than conforming that your regression is correctly specified (look at the literature to have some clues on this).
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Carlo:
          Thank you for the thoughtful advices, that helped a lot!

          I agree I would have further investigate the matter, rather than continuously running series of regressions.

          I'll leave a follow-up post if I do figure out what is going on!

          Comment

          Working...
          X