Code to carry out all analyses except bootstrapping