Does the optical density of a medium depend upon its mass density?

The optical density of a medium is quantified by its refractive index $n$. Does it have any correlation with the mass/number density of the medium? In other words is an optically denser medium must have a greater mass density compared to an optically rarer medium?

Index of refraction is $n = \sqrt{\varepsilon}\sqrt{\mu}$, where $\varepsilon$ and $\mu$ are relative permittivity(dielectric constant) and permeability. Usually materials have $\mu = 1$. Now the question is, is the dielectric constant dependent on mass density? Not directly. It depends on number density and atomic (molecular) polarizability. The polarizability does depend on mass. In simple models, it is inversely proportional to mass (search lorentz oscillator model).