Relations between terrestrial magnetism and cosmic-ray intensity