Hi,
I am working on my master thesis and I am currently busy with the data cleaning process. One of my independent variables is the annual stock return. Annual stock returns are to be calculated based on montly stock returns obtained from CRSP. As stock return data is not available every month for each firm, some studies require half of the yearly observations to be available, otherwise the firm year should be dropped. Therefore, I would like like to have a firm year level dropped if more than 6 months or more are missing (.). My data is structured as follows (note that FYPERMCO in an the identifier which is firm-year specific):
permno date permco ret fy FYPERMCO
12165 30nov2001 10043 .044108737 2001 89682
12165 31dec2001 10043 .037037145 2001 89682
12166 31oct1988 9999 . 1988 89354
12166 30nov1988 9999 . 1988 89354
12166 30dec1988 9999 0 1988 89354
12166 31jan1989 9999 -.047945205 1988 89354
12166 28feb1989 9999 -.007194245 1988 89354
12166 31mar1989 9999 -.021739131 1988 89354
Could somebody help me on this command? Help is highly appreciated. Thank you!
Related Posts with Conditional drop if command within a certain firm year level
One-sided t test regressionHello everyone, I don't have much experience with STATA and I'm working on my master's thesis. I wo…
How to create dummy variable with condition that it needs to have 3 observation in 5 years?I have a question how to create a dummy variable with certain conditions. I know how to create a dum…
(Two-Way) Fixed Effects Model: (Too) Many Post-Treatment Waves & Violated Constant Effect Assumption?Hi, I would be really very grateful for any suggestion on the following topic. I already searched q…
Estimate GARCH Model from Time SeriesHallo, I am a student and new to Stata. For a university course I have to model a GARCH model from …
Converting Date formatGreetings. I'm having a challenge converting the date formats with slashes "2/9/2016 14:06" (m/d/yyy…
Subscribe to:
Post Comments (Atom)
0 Response to Conditional drop if command within a certain firm year level
Post a Comment