The evolution of groups of galaxies in the Press-Schechter formalism