BookmarkSubscribeRSS Feed
redrover99
Calcite | Level 5

Hi all

I am looking to perform the following functions

-Sum  the squared revenues(REVT_SQUARED) by industry (HERFSIC) and year (FYEAR). As there are 7 different industries and 61 different years (1950-2011) there should be approx. 427 total revenues(TOTREV)...

-Divide the firms individual squared revenue (REVT_SQUARED) by the total revenue(TOTREV) for that particular industry (HERFSIC) and year (FYEAR) and call this variable "CONRATIO"

-CONRATIO'S should look like 0.15, 0.34 0.22 etc.

Help on performing this command would be very helpful. I am currently receiving very low concentration scores such as; 0.0003, 0.0012 etc. I am worried there might be an error with my command. data below

2 REPLIES 2
GeoffreyBrent
Calcite | Level 5

I'm a bit confused by "squared revenue" - not obvious why this would be of interest. But I'm assuming TOTREV is supposed to be the sum of squared revenue, not the sum of individual revenue, otherwise the ratio doesn't make much sense either. (You would get different answers depending on whether you worked in dollars or cents.)

Under those assumptions:

proc summary data=have nway;

class herfsic fyear;

var revt_squared;

output out=total_squared_revs (drop=_type_ _freq_) sum(revt_squared)=totrev;

quit;

proc sql;

create table want as select

a.*,

b.totrev,

a.revt_squared/b.totrev as conratio

from have as a join total_squared_revs as b

on (a.herfsic=b.herfsic AND a.fyear=b.fyear);

quit;

redrover99
Calcite | Level 5

Thanks Geoff

Squared revenue is just the revenue variable^2,

TOTREV is the summation of the squared revenue by year and industry. So your assumptions are correct.

I am following the calculation of the herfindahl index

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 1645 views
  • 0 likes
  • 2 in conversation