BookmarkSubscribeRSS Feed
Nieves
Quartz | Level 8

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!

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Please post test data in the form of a datastep in the code window - its the {i} above post area:

https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

 

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.

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 749 views
  • 0 likes
  • 3 in conversation