Hi SAS experts,
I would like to calculate a variable percentage of zero return, that is defined as, for each permno and year, number of trading days with zero return for each firm in a year/total number of trading days in a year. The data is CRSP daily data.
Currently, I only manage to count the number of trading days with zero return for each firm in the whole sample period, but not by year.
Looking forward to your help.
Thanks!
Please post test data in the form of a datastep in the code window - its the {i} above post area:
you also have not presented your code that you say you have working to a certain degree, so I will not re-write it, but only suggest that you create a year variable, and then use that in the by statement of your chosen procedure.
You already have a year variable, so use that in the select and group by.
Please post the code you tried.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: