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
Linear regression on estimation samlpe after multiple imputationI am conducting a multiple linear regression analysis on multiply imputed data. I wish to do a step…
Nearest Neighbor MatchingI am using Stata 16 for my analysis. I am trying to obtain treatment effects on the outcome variable…
sensitivity analysisDear all.. is there anyone who can guide we on sensitivity analysis on STATA..after performing prope…
Transformations of dependent variable or independent variable and growth ratesGood morning everyone I have two general questions that are confusing me for quite a while. Hopefu…
How to export results from kmirnov test to latex?Hi! I am a new user of stata and I am unable to export results from "ks test" from stata to a latex …
Subscribe to:
Post Comments (Atom)
0 Response to Conditional drop if command within a certain firm year level
Post a Comment