Macromolecular compounds comprising sulfonate or sulfate groups