LinReg Cause of N/A

I have a question about how the LinReg function is operating. I noticed that when I write a custom LinReg function like the following

Eval(LinReg(“FHist(Ins#ShrPurch/max(Ins#ShrSold,0.01),CTR*26)”, 10) ,RegGr%(2), NA)

it tends to return N/A quite frequently. So I decided to dig into it a bit. The screener linked to below has my work

https://www.portfolio123.com/app/screen/summary/286237?st=0&mt=1

Note that the screener returns the values going into the LinReg calculation for all of the stocks that evaluate to N/A. (I use the Compustat Engine).

If you download the results of the screen and take them into Excel and call the Slope function on each of the rows you will see that Excel has no problem handling the data (using 0-9 for the xValues).

So my question is why is the LinReg function failing for these cases? You will note that some of the rows contain an N/A but some don’t.

Solving my own problem somewhat using Slope instead of RegGr seems to get rid of a most of the N/A’s

There are still a few N/A’s for which Excel has no problem calculating a Slope. I assume this is due to the way that P123 vs Excel handles N/A’s in the data sent to the Slope calculation. Can P123 staff provide some clarity on how P123 handles N/A’s in the LinReg data.

Thanks,

Daniel

Unrelated, but I would stay away from the insider factors calculated form our provider. Awards are being treated as insider purchases. I think they are meaningless unless they are in lieu of salary.

In fact awarding lots of shares to insiders I would say is a bad sign. Company needs to keep giving out shares to retain people.

We have plans to redo them this year.

thanks marco, that is good to know.

some clarity on how P123 handles N/A’s in the LinReg data would still be appreciated

Cheers,

Daniel

Daniel,

Excel is probably quietly skipping over “NA” , a text value, so you are seeing a regressions of fewer samples.

All the stocks in your screen are feeding an N/A to LinReg which requires all values to not be NA.

Thanks Marco, that explanation matches what I have been seeing. Is there any chance it would be possible to build some NA handling options into the LinReg function (similar to the NA handling in the Loop functions).

Cheers,

Daniel