If a variable is completely NA then ds.mean() and ds.var() return the error:
Nvalid less than nfilter.tab
and the call fails. I am not sure that is the right behaviour because that is confusing for the analyst, perhaps they should return NA and not fail?