Calculating Industry Growth with Regression

I am attempting to develop an Industry Growth Factor (for Sales, OpInc, NetInc), but using the Regression Growth functions as opposed to the traditional method of

Gr%(OpInc(0,TTM),OpInc(N,TTM),N)

Unfortunately, given the available factors I am having a bit of trouble, and was hoping someone might have a workaround.

Note that SalesTTMInd, OpIncTTMInd, NetIncBXorTTMInd are not defined in the Factor Library, so to start we need to use the FSum function to create these Factors. So something like this

$OpIncTTMInd = FSum(OpInc(0,TTM),#Industry)

The next step will be to wrap that in a regression function, e.g.

$OpIncIndRegGrTTM = Eval(LinReg("FSum(OpInc(CTR*2,TTM),#Industry)", 10) ,RegGr%(2), NA)

In principle this should work, however the nested quotes seems to give the interpreter difficulties. When I attempt to run this function in the screener I get the following error:

ERROR: Encountered error in Rule 20: While computing Y with CTR=0 for LinReg: Could not find uid 44230 in function FSum – map size is 0

Anyone have a solution for this or another way to approach this problem?

I also tried this approach but I get a similar error message.

Eval(LinReg("FHist(`FSum("OpIncTTM",#Industry)`,CTR*26)", 10) ,RegGr%(2), NA)

The problem seems to be the need to create OpIncTTMInd, because for existing Industry Factors I can do the following without any trouble

Eval(LinReg("FHist(`DbtLT2EqQInd`,CTR*26)", 10) ,RegGr%(2), NA)

FSum will sum up the income for the stocks in an industry, so as soon as a company enters or leaves the industry or universe it will completely change. Also, FSum does not use CTR: that is only used by the Loop functions. For industry measures it’s best to use the Aggregate or FMedian commands.

Thanks Yuval that makes sense. Unfortunately, Aggregate seems to have the same problem as FSum. When I use the screener to evaluate the formula below

Eval(LinReg("Aggregate(`OpInc(CTR*2,TTM)`,#Industry)", 10) ,RegGr%(2), NA)

I get the following error message

ERROR: Encountered error in Rule 26: While computing Y with CTR=0 for LinReg: Could not find uid 44230 in function Aggregate – map size is 0

The FHist approach also fails

Eval(LinReg("FHist(`Aggregate("OpIncTTM",#Industry,#Avg)`,CTR*26)", 10) ,RegGr%(2), NA)

yields the following error message

ERROR: Encountered error in Rule 27: While computing Y with CTR=0 for LinReg: Could not find uid 44230 in function Aggregate – map size is 0

Not sure if I have a syntax error somewhere, or if the interpreter just can’t handle that many nested quotes.

-Daniel

Like I said, CTR is used only by the Loop functions. You can’t use it in any other function, including Aggregate.

Understood, but I’m not sure that is the issue here. Note that in the FHist implementation

Eval(LinReg("FHist(`Aggregate("OpIncTTM",#Industry,#Avg)`,CTR*26)", 10) ,RegGr%(2), NA)

CTR is not being passed to Aggregate but rather to FHist, and passing CTR to FHist works just fine, e.g.

Eval(LinReg("FHist(`DbtLT2EqQInd`,CTR*26)", 10) ,RegGr%(2), NA)

I stand corrected, and I apologize for not reading that formula correctly.

FHist cannot be used with cross-sectional functions. I think I have a solution for this and will be back soon.

Calculating an industry’s growth in sales or operating income should not start with the industry’s average or median sales or operating income. Instead, it has to start with the sales growth or operating income growth of each company in that industry, and then take the average or median of that. That’s how all industry growth factors are calculated, and it’s the standard way of looking at industry or sector growth.

One can calculate the sales growth or operating income growth of a company using LinReg, as you suggest. Eval(LinReg("Sales(CTR,TTM)",10),RegGr%(2),NA) should work fine in a ranking system or screen.

One currently cannot mix LinReg functions with cross-sectional functions like Aggregate, however.

The only workaround I know of is to create a number of different universes limited to the particular sectors, subsectors, or industries you want to examine. Then for each universe create an aggregate series using that universe and the command UnivMedian("1","Eval(LinReg(`Sales(CTR,TTM)`,10),RegGr%(2),NA)")

Run the series for the maximum time frame you need and save them. You can then call up those aggregate series in screens and ranking systems by using Close(0,GetSeries("[name of series]")).

Thanks for help on this Yuval!

Another option that would make things much simpler from my end would be to make more Industry Factors available. For example,

SalesTTMInd
EBITDATTMInd
OpIncTTMInd
NetIncBXorTTMInd
OperCashFlTTMInd
FCFTTMInd
CAPEXTTMInd

would all be nice to have.

Thanks,

Daniel

2 Likes