addMarginal, nobsY: new functions added