Dear Statalist members,
To select all observations, per ID, in my panel data set, I've written the following code:
This results in the following output
The BvD ID number is an unique identifier per firm (10 years of observations per firm).
Therefore, it should return only one BvD ID number, in this case, 3
Strangely enough, the display $idrandom does give only one result.
Could someone explain to my why Stata 12 returns TRUE in the IF statement for more values that ID == 3?
Thanks!
Kind regards,
Matthijs Alderliefste
To select all observations, per ID, in my panel data set, I've written the following code:
Code:
local idrandom round(runiform()*10) // generate random number to select unique ID tab id if id == $idrandom, nolabel // show results of corresponding ID display $idrandom // display the random number used
The BvD ID number is an unique identifier per firm (10 years of observations per firm).
Therefore, it should return only one BvD ID number, in this case, 3
Strangely enough, the display $idrandom does give only one result.
Could someone explain to my why Stata 12 returns TRUE in the IF statement for more values that ID == 3?
Thanks!
Kind regards,
Matthijs Alderliefste
Comment