  The associations of the angular positions of background quasars with
foreground galaxies, clusters of galaxies and quasars are often attributed to
the statistical lensing by gravitational potentials of the matter along the
lines of sight, although it has been known that none of the individual objects
(galaxies, clusters or quasars) are able to fully explain the reported
amplitudes of the quasar number enhancements. This probably arises from the
fact that the gravitational lensing effect by the environmental matter
surrounding these objects has been ignored. In this paper we conduct an
extensive study of the influence of the environmental matter on the prediction
of quasar enhancement factor by employing the spatial two-point correlation
function. Assuming a singular isothermal sphere for mass density profile in
galaxy and cluster of galaxies, we estimate the average surface mass density
$\overline{\Sigma}$ around galaxies, clusters and quasars from the
galaxy-galaxy, cluster-cluster, cluster-galaxy and quasar-galaxy correlations.
Our results show that the $\overline{\Sigma}$ induced quasar number enhancement
in the scenario of gravitational magnification depends critically on the mass
density parameters of galaxies ($\Omega_g$) and clusters of galaxies
($\Omega_c$) in the universe. For a flat cosmological model of $\Omega_0=1$ the
environmental matter can indeed play an important role in the lensing origin of
the quasar-quasar and quasar-galaxy associations if
$\Omega_g\sim\Omega_c\sim\Omega_0$, while it is unlikely that
$\overline{\Sigma}$ is sufficient to account for the reported quasar
overdensity behind quasars/galaxies if galaxies and clusters of galaxies
contribute no more than $25\%$ to the matter of the universe. Nonetheless, the
