Announcement

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

  • XTIVREG: Using an Instrument that is time-variant but ID-invariant

    Dear Stata Users,

    Thank you so much for reading my post.

    I would like to carry out instrumental variables and two-stage least squares for panel-data models using XTIVREG. However, I ran into the challenge of having an instrument that varies over time but does not vary over the product ID. My challenge is illustrated by the following dataset:

    ID Month SalesRank FBAFees GasolinePrice
    1 1 39563 3.96 3.782
    1 2 96540 4.24 3.444
    1 3 21310 4.24 3.541
    1 4 37170 3.47 3.798
    2 1 40247 5.4 3.782
    2 2 50556 5.4 3.444
    2 3 22251 5.4 3.541
    2 4 30257 5.4 3.798
    3 1 409 5.4 3.782
    3 2 354 5.4 3.444
    3 3 648 5.4 3.541
    3 4 767 4.63 3.798
    4 1 1226 5.4 3.782
    4 2 1090 5.4 3.444
    4 3 1207 5.4 3.541
    4 4 1738 5.4 3.798
    5 1 9113 5.4 3.782
    5 2 11801 4.75 3.444
    5 3 8431 4.75 3.541
    5 4 13638 4.75 3.798
    6 1 98707 3.96 3.782
    6 2 125262 4.24 3.444
    6 3 120474 4.24 3.541
    6 4 35379 4.24 3.798
    7 1 146329 3.96 3.782
    7 2 139578 4.24 3.444
    7 3 76410 4.75 3.541
    7 4 151836 4.75 3.798
    8 1 24420 4.75 3.782
    8 2 12359 4.75 3.444
    8 3 4182 4.75 3.541
    8 4 5001 4.75 3.798
    9 1 98993 7.38 3.782
    9 2 69962 8.13 3.444
    9 3 78277 8.13 3.541
    9 4 69242 8.13 3.798
    10 1 17312 4.75 3.782
    10 2 13986 4.75 3.444
    10 3 13473 4.75 3.541
    10 4 30690 4.75 3.798
    11 1 71248 4.75 3.782
    11 2 39559 4.75 3.444
    11 3 48265 4.75 3.541
    11 4 41813 3.98 3.798
    12 1 76878 6.75 3.782
    12 2 49403 7.49 3.444
    12 3 75122 7.49 3.541
    12 4 74494 7.49 3.798
    13 1 117994 3.96 3.782
    13 2 167140 4.24 3.444
    13 3 58382 4.24 3.541
    13 4 78328 3.47 3.798
    14 1 180105 5.4 3.782
    14 2 80731 5.4 3.444
    14 3 140701 5.4 3.541
    14 4 183443 5.4 3.798
    15 1 105144 3.96 3.782
    15 2 68103 4.24 3.444
    15 3 49684 4.24 3.541
    15 4 46905 3.47 3.798
    16 1 142 3.96 3.782
    16 2 121 4.75 3.444
    16 3 394 4.75 3.541
    16 4 459 4.75 3.798
    17 1 131767 5.4 3.782
    17 2 151850 5.69 3.444
    17 3 97051 5.69 3.541
    17 4 169016 5.69 3.798
    18 1 131767 5.4 3.782
    18 2 148501 5.4 3.444
    18 3 97051 5.4 3.541
    18 4 165553 5.4 3.798
    19 1 3379 6.08 3.782
    19 2 2304 6.1 3.444
    19 3 4009 6.1 3.541
    19 4 4145 6.1 3.798
    20 1 1892 5.4 3.782
    20 2 2218 5.4 3.444
    20 3 1455 5.4 3.541
    20 4 1126 5.4 3.798
    21 1 1226 5.4 3.782
    21 2 1216 5.4 3.444
    21 3 1207 4.75 3.541
    21 4 1738 3.98 3.798
    22 1 131767 6.08 3.782
    22 2 151850 6.1 3.444
    22 3 102292 6.1 3.541
    22 4 169016 6.1 3.798
    23 1 6313 3.96 3.782
    23 2 7139 4.24 3.444
    23 3 6259 4.24 3.541
    23 4 8042 3.47 3.798
    24 1 95594 13.78 3.782
    24 2 2369 14.35 3.444
    24 3 65903 14.35 3.541
    24 4 53567 9.89 3.798
    25 1 5496 5.4 3.782
    25 2 4200 5.4 3.444
    25 3 4679 5.4 3.541
    25 4 6101 5.4 3.798
    end
    ************************************************** *******
    I intend to run the following regression:

    xtivreg SalesRank (FBAFees = GasolinePrice) [Controls], fe

    But as you can see, GasolinePrice does not vary by product ID but varies over time. Hence, I ask the following questions:

    (1) Is there a way to use GasolinePrice in the above model that is justified in the econometric literature?
    (2) Is there a way to create a new variable using GasolinePrice that can vary by time and product ID, which can be used in the above model?
    (3) Has a similar challenge been faced and resolved in the econometric literature?
    (4) Are there any other suggestions that you may have to circumvent or address this challenge?

    Thank you so much for your help.
Working...
X