Code for doing analyses with Bas.