Announcement

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

  • Xtreg results in insufficient observations

    Hi everyone, I am currently running a regression where I am measuring the impact of factors on the return on company merger & acquisition transactions. I have merged 6 datasets together with multiple variables to analyse to create a panel dataset and up till this point everything works. I have 853 unique firm transactions from 1995 to 2021 but not every date is covered and there are a couple dates where 2 transactions have taken place. I have specified the dataset using xtset with TargetID from 1-860 as the panel variable and Date as the Date variable. It comes up as weakly balanced. I have also increased memory size to 32,000.

    Code:
    xtset TargetID Date2

    Whenever I try to run any regression with xtreg, it comes up with insufficient observations regardless of the number of explanatory variables. If I run the same variables under a normal linear regression using the standard reg command, it produces an output. I was wondering what my error is with regards to not being able to use xtreg to run my regression over time.

    Code:
    gen excess = cprem3day - RF
    xtreg excess MKTRf SMB HML
    predict phat
    gen CAR = cprem3day - (RF+phat)
    Click image for larger version

Name:	Screenshot (310).png
Views:	1
Size:	373.8 KB
ID:	1654681


    Click image for larger version

Name:	Screenshot (309).png
Views:	1
Size:	378.2 KB
ID:	1654682


    Many thanks in advance! I have consulted many forums and have not come across an answer that works so I hope that you can help.

  • #2
    For fixed effects, you need at least two observations per group. Your data shows that you have one observation for each of your 853 groups, so there is no within variation to exploit. Consider the Grunfeld dataset:

    Code:
    webuse grunfeld, clear
    list if inrange(company, 1, 3), sepby(company)
    Here, you have 20 observations for each group (company)

    Code:
    . list if inrange(company, 1, 3), sepby(company)
    
         +--------------------------------------------------+
         | company   year   invest   mvalue   kstock   time |
         |--------------------------------------------------|
      1. |       1   1935    317.6   3078.5      2.8      1 |
      2. |       1   1936    391.8   4661.7     52.6      2 |
      3. |       1   1937    410.6   5387.1    156.9      3 |
      4. |       1   1938    257.7   2792.2    209.2      4 |
      5. |       1   1939    330.8   4313.2    203.4      5 |
      6. |       1   1940    461.2   4643.9    207.2      6 |
      7. |       1   1941      512   4551.2    255.2      7 |
      8. |       1   1942      448   3244.1    303.7      8 |
      9. |       1   1943    499.6   4053.7    264.1      9 |
     10. |       1   1944    547.5   4379.3    201.6     10 |
     11. |       1   1945    561.2   4840.9      265     11 |
     12. |       1   1946    688.1   4900.9    402.2     12 |
     13. |       1   1947    568.9   3526.5    761.5     13 |
     14. |       1   1948    529.2   3254.7    922.4     14 |
     15. |       1   1949    555.1   3700.2   1020.1     15 |
     16. |       1   1950    642.9   3755.6     1099     16 |
     17. |       1   1951    755.9     4833   1207.7     17 |
     18. |       1   1952    891.2   4924.9   1430.5     18 |
     19. |       1   1953   1304.4   6241.7   1777.3     19 |
     20. |       1   1954   1486.7   5593.6   2226.3     20 |
         |--------------------------------------------------|
     21. |       2   1935    209.9   1362.4     53.8      1 |
     22. |       2   1936    355.3   1807.1     50.5      2 |
     23. |       2   1937    469.9   2676.3    118.1      3 |
     24. |       2   1938    262.3   1801.9    260.2      4 |
     25. |       2   1939    230.4   1957.3    312.7      5 |
     26. |       2   1940    361.6   2202.9    254.2      6 |
     27. |       2   1941    472.8   2380.5    261.4      7 |
     28. |       2   1942    445.6   2168.6    298.7      8 |
     29. |       2   1943    361.6   1985.1    301.8      9 |
     30. |       2   1944    288.2   1813.9    279.1     10 |
     31. |       2   1945    258.7   1850.2    213.8     11 |
     32. |       2   1946    420.3   2067.7    132.6     12 |
     33. |       2   1947    420.5   1796.7    264.8     13 |
     34. |       2   1948    494.5   1625.8    306.9     14 |
     35. |       2   1949    405.1     1667    351.1     15 |
     36. |       2   1950    418.8   1677.4    357.8     16 |
     37. |       2   1951    588.2   2289.5    342.1     17 |
     38. |       2   1952    645.5   2159.4    444.2     18 |
     39. |       2   1953      641   2031.3    623.6     19 |
     40. |       2   1954    459.3   2115.5    669.7     20 |
         |--------------------------------------------------|
     41. |       3   1935     33.1   1170.6     97.8      1 |
     42. |       3   1936       45   2015.8    104.4      2 |
     43. |       3   1937     77.2   2803.3      118      3 |
     44. |       3   1938     44.6   2039.7    156.2      4 |
     45. |       3   1939     48.1   2256.2    172.6      5 |
     46. |       3   1940     74.4   2132.2    186.6      6 |
     47. |       3   1941      113   1834.1    220.9      7 |
     48. |       3   1942     91.9     1588    287.8      8 |
     49. |       3   1943     61.3   1749.4    319.9      9 |
     50. |       3   1944     56.8   1687.2    321.3     10 |
     51. |       3   1945     93.6   2007.7    319.6     11 |
     52. |       3   1946    159.9   2208.3      346     12 |
     53. |       3   1947    147.2   1656.7    456.4     13 |
     54. |       3   1948    146.3   1604.4    543.4     14 |
     55. |       3   1949     98.3   1431.8    618.3     15 |
     56. |       3   1950     93.5   1610.5    647.4     16 |
     57. |       3   1951    135.2   1819.4    671.3     17 |
     58. |       3   1952    157.3   2079.7    726.1     18 |
     59. |       3   1953    179.5   2371.6    800.3     19 |
     60. |       3   1954    189.6   2759.9    888.9     20 |
         +--------------------------------------------------+
    
    .

    Comment

    Working...
    X