Hi all,
I got a question regarding the reconstruction of my dataset using multiple if commands.I designed a fixed effects model and I would like to introduce auditor-firm fixed effects into the model to check the robustness of my results. I obtained my data from compustat and used the variable AU to identify the auditor for each observation. AU is a categorical variable that indicates 1 for Arthur Anderson, 2 for Arthur Young (prior to 1989) etc. My sample period range from 1980 until 2000 and therefore it includes several audit firm mergers. Some observations are for example audited by Arthur Young (au=2) before 1989, but are audited by Ernst & Young (au=4) after 1989. Therefore, they are still audited by the same auditor, but they would be considered as a different group since AU changed from 2 to 4.
If I would use command reghdfe ..... , a(au#gvkey), stata would identify the pre-merger and post-merger observations as different groups, which is incorrect because the firm is still audited by the same auditor. I would like to restructure the data in a way that stata could identify the pre- and post-merger observations as one group. This would mean that the observation should be identified as AU=2 after 1989, because stata would then recognize it as a single group (which is plausible because the firm is still audited by the same auditor).
I am not sure how I could implement this in stata. I think I should use the replace if command, but I don't know how to use multiple commands for different variables (au & year at once). Could somebody assist me on this? Thanks a lot!
Related Posts with Restructuring of variables using multiple if conditions
estat archlm, lags(1) no observations r(2000)Hello. I am working to build a CAPM-GARCH model in Stata in order to explain and predict the return…
Formatting Date so STATA can understand...I have date from Excel that is formatted as 8/31/15. The date has gaps. What's the optimal way of fo…
GSEM: Using a latent variable as an explanatory variable in the multinomial logistic regressionHi, Is it possible to use CFA outputs, latent variables, as explanatory (independent) variables in …
Plotting a subset of a sample (%) using a barchartHi, I am trying to plot the share of male smokers of the population against the 4 education categor…
Problem with tokenize a local variable using mata and tabstatmatHi all, I am trying to get label names from a tabstat matrix, I am using tabstatmat ado, an example…
Subscribe to:
Post Comments (Atom)
0 Response to Restructuring of variables using multiple if conditions
Post a Comment