In this work, self-absorption correction factor related to the variation of the composition and the density of soil samples were evaluated using the p-type HPGe detector. The validated MCNP5 simulation model of this detector was used to evaluate its Full Energy Peak Efficiency (FEPE) under the variation of the composition and the density of the analysed samples. The results indicates that FEPE calculation of low gamma ray is affected by the composition and the density of soil samples. The self-absorption correction factors for different gamma-ray energies which was fitted as a function of FEPEs via density and energy and fitting parameters as polynomial function for the logarithm neper of gamma ray energy help to calculate quickly the detection efficiency of detector. Factor Analysis for the influence of the element composition in analysed samples on the FEPE indicates the FEPE distribution changes from non-metal to metal groups when the gamma ray energy increases from 92 keV to 238 keV. At energies above 238 keV, the FEPE primarily depends only on the metal elements and is significantly affected by aluminium and silicon composition in soil samples.