Dear Stata community,

I am new to this forum and I have a question that I hope you might be able to help me with. I am already looking forward to all your answers and I appreciate any help.
I have a dataset of 1061 funds, with monthly returns over an observation period of one year. An excerpt of my data is shown below. Each fund is assigned monthly to a category. The category ranges from one to five. I have coded the categories each as binary dummies that take the values of 1 or 0. A fund is always assigned to a category. Afterwards I am running a Fama-MacBeth (1973) cross-sectional regression on the returns using the five categorical dummy variables. The data is tset using the time and the id variable.

The command I used is:
Code:
xtfmb return category1-category5, verbose
My problem now lies in the results. The output should have one of the categories as a reference group, as is usually the case when using dummies in order to avoid the dummy trap. However, as you can see, thanks to the verbose option, the command randomly switches the reference group in period 4.

Code:
 Fama-MacBeth (1973) Two-Step procedure           Number of obs     =     12636
                                                 Num. time periods =        12
                                                 F(  5,    11)     =      6.61
                                                 Prob > F          =    0.0045
                                                 avg. R-squared    =    0.0142
------------------------------------------------------------------------------
             |            Fama-MacBeth
      return |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   category1 |  -.0871156   .1408357    -0.62   0.549    -.3970928    .2228616
   category2 |  -.2474867   .0693893    -3.57   0.004    -.4002115   -.0947618
   category3 |  -.3170871   .0847194    -3.74   0.003    -.5035533   -.1306209
   category4 |    -.26298   .1141841    -2.30   0.042    -.5142976   -.0116624
   category5 |     .03865   .0783116     0.49   0.631    -.1337126    .2110126
       _cons |   2.611412   1.049872     2.49   0.030      .300658    4.922165
------------------------------------------------------------------------------
 
Coefficient estimates and R-squared of the cross-sectional regressions in step 1
 
  +-----------------------------------------------------------------------------------------+
  |    t   category1   category2   category3   category4   category5    constant         R2 |
  |-----------------------------------------------------------------------------------------|
  |    1    .4344505    -.228922   -.2035567   -.0755477           0   -2.331923   .0160394 |
  |    2    -.177046    .0927636   -.0413412    .0228245           0   -2.099789   .0025636 |
  |    3   -.3032117   -.2651791    .0010795    .0686145           0    .9230851   .0123559 |
  |    4           0     -.14465   -.6117229   -.9204065   -.3680532    8.277284   .0206276 |
  |    5    .8791369   -.3884479   -.8193883   -.6779399           0    7.370638   .0279175 |
  |    6   -.5546124   -.6481683   -.5683015    -.466524           0    1.945532   .0143326 |
  |    7    .0272208   -.0659638   -.2614845   -.2483393           0    3.133548   .0026008 |
  |    8    .1238221   -.1898798    -.341636    -.219288           0    3.311563   .0054121 |
  |    9           0    .0572629    .1463949    .3819014     .831853   -1.900778   .0269807 |
  |   10    .1218781   -.4316996   -.4608506   -.7052758           0    6.982424   .0134108 |
  |   11    -.725821   -.6341645   -.5627483   -.4840091           0    2.382174   .0149581 |
  |   12   -.8712051   -.1227916   -.0814895      .16823           0    3.343182   .0133504 |
  |-----------------------------------------------------------------------------------------|
  | Mean   -.0871156   -.2474867   -.3170871     -.26298      .03865    2.611412   .0142125 |
  |    N          12          12          12          12          12          12         12 |
  +-----------------------------------------------------------------------------------------+
I unfortunately cant figure out what the reason behind this may be, and I know that xtfmb is a user-written command, but I hope that nonetheless one of you maybe has an idea.
I additionally tried to use Professor Shahs asreg command with the fmb option (many thanks to him for that) yet ran into the same problem.

Looking forward to your answers!

Sincerely,

Leon

The data I used looks as follows:
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(t idd return) byte(category1 category2 category3 category4 category5)
 1 1 -2.84 1 0 0 0 0
 2 1  -1.5 1 0 0 0 0
 3 1  1.51 1 0 0 0 0
 4 1  7.47 1 0 0 0 0
 5 1  3.35 1 0 0 0 0
 6 1   .22 1 0 0 0 0
 7 1  1.98 1 0 0 0 0
 8 1  1.78 1 0 0 0 0
 9 1 -1.75 1 0 0 0 0
10 1  5.33 1 0 0 0 0
11 1   .22 1 0 0 0 0
12 1  3.94 1 0 0 0 0
 1 2 -1.83 0 0 1 0 0
 2 2 -3.31 0 0 1 0 0
 3 2  2.12 0 0 1 0 0
 4 2  8.09 0 1 0 0 0
 5 2 10.31 0 0 1 0 0
 6 2  3.12 0 0 1 0 0
 7 2  7.86 0 0 1 0 0
 8 2  8.16 0 0 1 0 0
 9 2 -3.58 0 0 1 0 0
10 2  9.16 0 0 1 0 0
11 2  3.38 0 0 1 0 0
12 2 -1.53 0 0 1 0 0
 1 3 -2.51 0 0 1 0 0
 2 3 -2.25 0 0 1 0 0
 3 3  -.21 0 0 1 0 0
 4 3  7.61 0 0 1 0 0
 5 3  5.69 0 0 1 0 0
 6 3   1.4 0 0 1 0 0
 7 3   1.4 0 0 1 0 0
 8 3  2.01 0 0 1 0 0
 9 3 -1.25 0 0 1 0 0
10 3  5.32 0 0 1 0 0
11 3  1.04 0 0 1 0 0
12 3  5.95 0 0 1 0 0
 1 4 -3.06 0 0 0 1 0
 2 4 -2.04 0 0 0 1 0
 3 4  -.47 0 0 0 1 0
 4 4  7.15 0 0 0 1 0
 5 4  6.44 0 0 0 1 0
 6 4   1.1 0 0 0 1 0
 7 4  2.09 0 0 0 1 0
 8 4  1.41 0 0 0 1 0
 9 4 -1.33 0 0 0 1 0
10 4  3.41 0 0 0 1 0
11 4  1.05 0 0 0 1 0
12 4  4.41 0 0 0 1 0
 1 5 -2.33 0 0 1 0 0
 2 5 -1.49 0 0 1 0 0
 3 5   .96 0 0 1 0 0
 4 5  7.94 0 0 1 0 0
 5 5  3.67 0 0 1 0 0
 6 5  1.46 0 0 1 0 0
 7 5   1.8 0 0 1 0 0
 8 5   .85 0 0 1 0 0
 9 5  -.68 0 0 1 0 0
10 5  4.06 0 0 1 0 0
11 5   .22 0 1 0 0 0
12 5  5.51 0 0 1 0 0
 1 6 -3.14 0 0 0 0 1
 2 6 -1.97 0 0 0 0 1
 3 6   .67 0 0 0 0 1
 4 6  7.76 0 0 0 1 0
 5 6  6.61 0 0 0 1 0
 6 6  2.21 0 0 0 1 0
 7 6  4.67 0 0 0 1 0
 8 6  4.35 0 0 0 1 0
 9 6 -3.43 0 0 0 1 0
10 6  7.36 0 0 0 1 0
11 6  2.96 0 0 0 1 0
12 6   .57 0 0 0 1 0
 1 7 -3.12 0 0 1 0 0
 2 7  -.82 0 0 1 0 0
 3 7   -.2 0 0 1 0 0
 4 7  9.44 0 0 1 0 0
 5 7  7.57 0 0 1 0 0
 6 7  -.19 0 0 1 0 0
 7 7  5.09 0 0 0 1 0
 8 7   3.4 0 0 0 1 0
 9 7 -2.21 0 0 0 1 0
10 7  8.79 0 0 0 1 0
11 7  2.39 0 0 0 1 0
12 7  2.09 0 0 1 0 0
 1 8  -5.7 0 1 0 0 0
 2 8 -1.54 0 1 0 0 0
 3 8  1.38 0 1 0 0 0
 4 8  9.74 0 0 1 0 0
 5 8  7.75 0 0 1 0 0
 6 8  1.29 0 0 1 0 0
 7 8  4.59 0 0 0 1 0
 8 8  2.43 0 0 0 1 0
 9 8 -1.91 0 0 0 1 0
10 8  5.07 0 0 0 1 0
11 8  1.78 0 0 1 0 0
12 8  1.66 0 0 1 0 0
 1 9 -2.29 0 0 0 1 0
 2 9 -2.08 0 0 0 1 0
 3 9   .23 0 0 0 1 0
 4 9  8.18 0 0 0 1 0
end