BookmarkSubscribeRSS Feed
fyuksel
Calcite | Level 5

I have a dataset like that. gvkey is firm identifier

 

gvkeyfyeardvcsharerepurmarketcap
100419907.6512.326224.4604
100419967.9760564.3237
100419989.3757.558540.7748
100419999.2180372.7519
10042012014.6790.0029
1004201411.9151.51046.395
1004201510.418.8842.5112
1019199600.53922.581
101919970.332.97737.41
101919980.3290.50435.604
101920000.335030.378
101920010.3252.29839.721
103419912.7093.759417.3085
103420067.384307.3971038.686

 

From this date table I want to find number of firms, dividend paying firms and repurchasing firms in each year as well as their percentage. The table will look like that:

 

yearnumber of firmsdividend payerspercentage of divident payerrepurchaserspercantege of repurchases
19901458105272.15%35024.01%
1991345285224.68%52315.15%
1992345296527.95%1524.40%
199354991232.24%4528.22%
199452121853.55%85416.39%

 

I can get number of firms  by proc freq but how can I get number of dividend payer and repurchaser?

2 REPLIES 2
Reeza
Super User

@fyuksel wrote:

 

I can get number of firms  by proc freq but how can I get number of dividend payer and repurchaser?


How are you calculating/defining that based on the data you've provided?

s_lassen
Meteorite | Level 14

@fyuksel:

If I understand your question correctly, what you want is something like this:

 

proc sql;
  create table want as select
    year,
    count(*) as no_of_firms,
    sum(DVC>0) as dividend_payers,
    calculated dividend_payers/calculated no_of_firms as pct_dividend_payers format=percent6.2,
    sum(sharerepur>0) as repurchasers,
    calculated repurchasers/calculated no_of_firms as pct_repurchasers format=percent6.2
  from have
  group by year
  order by year
  ;
quit;

   

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1067 views
  • 1 like
  • 3 in conversation