Help to calculate PE10 with LoopSum

Can someone please advise on how to calculate the Cumulative 10 yr earnings (for S&P500)?

I’ve tried this but think the “ANN” is screwing it up as you can’t have quotes in quotes?

setvar(@ern10, UnivSum(“1”, LoopSum(“NetIncBXor(CTR,“ANN”)”,10))

Shaun, just remove the inner quotes. It should be:
setvar(@ern10, UnivSum(“1”, LoopSum(“NetIncBXor(CTR,ANN)”,10))

I’ve tried your suggestion but get: ERROR: In Rule 6: Error near ‘NetIncBXor’: Invalid command ‘NetIncBXor’

It looks right to me but the machine doesn’t like it.

Shaun - it looks like NetIncBXor is not supported in custom series or it is an error. I suggest raising it as an error as I don’t think you are doing anything wrong.
Steve

Be careful with this, especially if you’re trying to use this for a Shiller PE.

NetIncBXor is a very wonky number that’s often heavily distorted by unusual items. Forget the BXor part of the factor; sadly and for reasons best known only by them, the accounting profession has defined Xor almost out of existence; my understanding is that even losses relating to to the 9/11 attack were not able to be classified as Xor. Sigh . . . .

You probably should consider creating your own substituted for NetIncBXor; possibly something along the lines of NetIncBXor + (.65*SpcItems). SpciItems is a pretax figure (another great contribution from the accounting profession - the companies disclose the special items pretax but are not compelled to disclose the tax impact, so it’s probably best to simply assume a generic tax rate and then convert to an after-tax estimate.

I’ve searched Shiller’s content on his CAPE or PE10 and really had a hard time deciphering what, if anything, he does about unusuals. From the data he makes available, it looks like he is eliminating that. But I have not been able to trace that from his writings. However, Shiller did cite Graham & Dodd as his inspiration for use of a 10-year average, and they were very definitive about the importance of eliminating unusuals. I suspect Shiller may have been working with top-down S&P 500 figures, which S&P typically presents as not including unusuals.

Also, by the way, Shiller doesn’t actually compute company CAPE/PE10. He uses it strictly as a macro market-assessment metric; as a generalized rule of thumb rather than a hard-and-fast quantitative rule. And he averages 10-year inflation adjusted earnings, not 10-year earnings. (You can do that on P123 since we now have economic data including CPI).

It looks like you’re nesting quoted strings in the series command and the loopsum command.

As a workaround, I created a custom formula, $LoopSumTest, with this formula in it:

LoopSum("NetIncBXor(CTR,ANN)",10)

Then the series rule becomes:

setvar(@ern10, UnivSum("1", "$LoopSumTest"))

That seems to work.

Thank you everyone.

It works after pdemartino’s solution.
Now to work on the inflation adjustment.

I’m going to using it on a smoothed basis so not overly concerning with actual level but more the trend.

Paul - I tried the following series rules:

LoopSum(“NetIncBXor(CTR,ANN)”,10)
SetVar(@X1,LoopSum(“NetIncBXor(CTR,ANN)”,10))

Both give an error for NetIncBXor.

So it seems to me that the module is complaining about NetIncBXor as neither rule has nested quotes. The fact that it works when you define a custom formula means to me that the removal of NetIncBXor is the issue.

Steve

If we’re talking about the series tool, you need to put stock formulas into one of the universe operations. (UnivSum, in this case.)

OK Paul - This is starting to get a bit obscure…

You can use SetVar in a series. The example given is: SetVar(@1wkRet, 100*(Close(0)-Close(5))/Close(5))

You can use LoopSum in a series: Loopsum(…,…)

You can use a custom formula in a series. The custom series can call up a stock formula. setvar(@ern10, UnivSum(“1”, “$LoopSumTest”))

You can’t use a stock formula directly, such as NetIncBXor(0,ANN) (;

I appreciate the power of P123 but I have to tell you/P123 that the tools are getting way too complicated for the average user.

Steve