  In this paper we present a state vector analysis of the generation of atomic
spin squeezing by measurement of an optical phase shift. The frequency
resolution is improved when a spin squeezed sample is used for spectroscopy in
place of an uncorrelated sample. When light is transmitted through an atomic
sample some photons will be scattered out of the incident beam, and this has a
destructive effect on the squeezing. We present quantitative studies for three
limiting cases: the case of a sample of atoms of size smaller than the optical
wavelength, the case of a large dilute sample and the case of a large dense
sample.
