regression scripts from Dalgaard's book